What is DB2 REST Api?
Abhishek Verma
Mainframe Modernization Go-to-market Leader Professional Services EMEA | Enterprise Transformation & Cloud Consulting
What is REST Api?
A RESTful API is an architectural style for an Application Program Interface (API) that uses HTTP requests to access and use data. That data can be used to GET, PUT, POST and DELETE data types, which refers to the reading, updating, creating and deleting of operations concerning resources.
An API for a website is code that allows two software programs to communicate with each other. The API spells out the proper way for a developer to write a program requesting services from an operating system or other application
Layman's term:
Let’s say you’re trying to find videos about "Java" on Youtube. You open up Youtube, type "Java" into a search field, hit enter, and you see a list of videos about Java. A REST API works in a similar way. You search for something, and you get a list of results back from the service you’re requesting from.
Using the HTTP protocol means REST is a simple request/response mechanism. Each request returns a subsequent response. You can see what a simplified request and response look like below:
REST Api Commands:
A RESTful API uses commands to obtain resources. The state of a resource at any given timestamp is called a resource representation. A RESTful API uses existing HTTP methodologies defined by the RFC 2616 protocol, such as:
- GET to retrieve a resource;
- PUT to change the state of or update a resource, which can be an object, file or block;
- POST to create that resource; and
- DELETE to remove it.
With REST, networked components are a resource the user requests access to -- like a black box whose implementation details are unclear. All calls are stateless; nothing can be retained by the RESTful service between executions.
DB2 REST endpoint:
You can set up your Db2? system so that application programmers can create Representational State Transfer (REST) endpoints that can be used to interact with Db2.
Each endpoint is associated with a single SQL statement. Authenticated users of web, mobile, or cloud applications can use these REST endpoints from any REST HTTP client without having to install any Db2 drivers.
The Db2 REST server accepts an HTTP request, processes the request body, and returns results in JavaScript Object Notation (JSON).
Want to know how to use DB2 Rest Api?
Watch the below series of 4 videos from IBM about you can configure the DB2 Rest Api service and how can you use it to access data from web, mobile, or cloud applications.
Db2 Systems Programmer | R&D | DBA
4 年I made an example of using Db2 REST services: https://www.dhirubhai.net/posts/ron-hameiri_db2-rest-zos-activity-6577874632735506432-w4V9