Skip to content

HTTP Rest Call Gateway Layer

shubhamphepale edited this page Nov 30, 2021 · 1 revision

What is an API gateway layer?

An API gateway is an API management tool that sits between a client and a collection of backend services. An API gateway acts as a reverse proxy to accept all application programming interface (API) calls, aggregate the various services required to fulfill them, and return the appropriate result.

  • HTTP Protocol : The HTTP protocol is the client server-based architecture where web browsers, robots and search engines, etc., acts like http clients, and the server acts as a server. The http client requests a URL, which is having a protocol version, a domain name followed by the file or directories name. The http server responds, including the message’s protocol version and a success or error code, followed by a MIME-like message containing server information, entity meta-information, and possible entity-body content.

  • HttpURLconnection : It is a http specific URLConnection. It works for http protocol only.

    • This abstract class extends URLConnection class which is present in java.net package
    • It extends from URLConnection with some extra http related functionalities.
  • GET Request API call to external URL

    • Here we are create Get Request to pass some parameters like acceptHeader, authHeader, urlHeader and paramsHeader and store these parameters into a Map. Using makeGetRequest() we are calling the GET Request URL.

GetCall

  • POST Request API call to external URL

    • Here we are create POST Request to pass some parameters like acceptHeader, authHeader, urlHeader and paramsHeader and store these parameters into a Map. Using makePostRequest() we are calling the Post Request URL.

PostCall

Clone this wiki locally