The HttpRequest library is a library for sending HTTP requests to a web server and receiving responses from the server.

The outline of the HttpRequest library is as follows.

Initialize the library

First, initialize the library with HTTP_InitHttpRequest function.
When you are done using the HttpRequest library, call HTTP_DeinitHttpRequest function to free the library resources.

Define HTTP request

Use HTTP_CreateRequest function to generate a resource that defines the contents of the HTTP request, and get the HTTP request handle to refer to that resource. Specify the following items.
  • URL of the server. You can also specify the port number and query parameters.
  • HTTP request method. Specify GET or POST.
  • Transmission data
  • HTTP request header
  • Time-out time waiting for response
  • Other option

After processing the HTTP request, release the resource with HTTP_CloseRequest function.

Send HTTP request and receive response

Pass the HTTP request handle to HTTP_GetResponse function to send the HTTP request and receive the HTTP response. You can get the following information:
  • Status code of the HTTP response
  • HTTP response header
  • Received data


Last updated: 2020/10/17