c0de_net/http
The HTTP library has one type for the connection to a server and one function for every HTTP method. All functions return the raw data of the answer, its status and its headers.
Chapters
- Getting started: Programs that use the library include it with INCLUDE c0de_net/http. Its type and functions start with the library name, like c0de_net/http/HTTP_GET.
- Errors: The functions raise these errors. Catch them with a variable of type ERROR on the CALL line, and check its code.
- Examples: Complete programs that use c0de_net/http. The servers are examples; replace them with the API you want to use.
Functions
- HTTP_CONNECTION: A struct type with the base information of the requests to one server.
- HTTP_GET: Sends a GET request and returns the answer.
- HTTP_HEAD: Sends a HEAD request: like GET, but the answer has no data.
- HTTP_OPTIONS: Sends an OPTIONS request: asks the server which methods an endpoint supports.
- HTTP_TRACE: Sends a TRACE request: the server sends the request back as it received it.
- HTTP_DELETE: Sends a DELETE request: removes something on the server.
- HTTP_PATCH: Sends a PATCH request: changes a part of something on the server.
- HTTP_POST: Sends a POST request: sends data to the server, e.g. to create something.
- HTTP_PUT: Sends a PUT request: stores something on the server, replacing what was there.