Consts module
Constants for HTTP requests: media types for the Content-Type header and the names of two header fields. cHttpClient uses them; a program can use them to set the headers of a request. Eight constants, all String.
Debug.Print Consts.TOOLS_HTTP_CONTENT_TYPE_JSON
Debug.Print Consts.TOOLS_HTTP_HEADER_FIELD_CONTENT_TYPE
' Output:
' application/json
' Content-Type
The same media types are also declared in ToolsHttp with other names (C_CONTENT_TYPE_JSON and so on), and cHttpClient.SetRequestContentType chooses one by number.
Constants
TOOLS_HTTP_CONTENT_TYPE_FORM_MULTIPART
multipart/form-data, the media type of a form that uploads files.
TOOLS_HTTP_CONTENT_TYPE_FORM_URLENCODED
application/x-www-form-urlencoded, the media type of a form of name=value pairs. cHttpClient uses it when a request has no Content-Type header and RequestContentType is empty.
TOOLS_HTTP_CONTENT_TYPE_JSON
application/json.
TOOLS_HTTP_CONTENT_TYPE_STREAM
application/octet-stream, the media type of bytes of no known kind.
TOOLS_HTTP_CONTENT_TYPE_TEXT_HTML
text/html.
TOOLS_HTTP_CONTENT_TYPE_TEXT_PLAIN
text/plain.
TOOLS_HTTP_HEADER_FIELD_CONTENT_LENGHT
The text Content-Lenght. The name of the constant and its text both misspell Content-Length. cHttpClient sends a header with this name, with the size of the body, on every request that has a body. Servers do not read it: WinHTTP adds the correct Content-Length header by itself, so a request carries both.
TOOLS_HTTP_HEADER_FIELD_CONTENT_TYPE
The text Content-Type.
See Also
- cHttpClient class – sends the requests
- ToolsHttp module – the same media types under other names
- TBMANLIB package – overview