glitchedhttps
Public Attributes | List of all members
glitchedhttps_request Struct Reference

Struct containing an HTTP request's parameters and headers. More...

#include <glitchedhttps_request.h>

Collaboration diagram for glitchedhttps_request:
Collaboration graph
[legend]

Public Attributes

char * url
 
size_t url_length
 
enum glitchedhttps_method method
 
char * content
 
size_t content_length
 
char * content_type
 
size_t content_type_length
 
char * content_encoding
 
size_t content_encoding_length
 
struct glitchedhttps_headeradditional_headers
 
size_t additional_headers_count
 
size_t buffer_size
 
int ssl_verification_optional
 SET THIS TO FALSE! More...
 

Detailed Description

Struct containing an HTTP request's parameters and headers.

Member Data Documentation

◆ additional_headers

struct glitchedhttps_header* glitchedhttps_request::additional_headers

[OPTIONAL] Additional headers for the HTTP request.

Set this to NULL if you don't want to add any additional HTTP request headers.

You can create headers using the glitchedhttps_header_init() function.

◆ additional_headers_count

size_t glitchedhttps_request::additional_headers_count

The amount of passed additional HTTP request headers (pass zero if there's none).

◆ buffer_size

size_t glitchedhttps_request::buffer_size

How big should the underlying text buffer be?

◆ content

char* glitchedhttps_request::content

The HTTP request body. Set this to NULL if you don't want to send a request body.

Note that this is ignored for GET requests, as well as every other HTTP Method that does not recommend the inclusion of a body... And if your server looks for it nonetheless you're infringing the RFC2616 recommendation!

See also
https://tools.ietf.org/html/rfc2616#section-4.3
https://stackoverflow.com/a/983458

◆ content_encoding

char* glitchedhttps_request::content_encoding

The request body's encoding (e.g. "gzip").

◆ content_encoding_length

size_t glitchedhttps_request::content_encoding_length

content_encoding string length.

◆ content_length

size_t glitchedhttps_request::content_length

Content-Length header that tells the server how many bytes to read from the message body. If this is zero, strlen(content) will be used!

◆ content_type

char* glitchedhttps_request::content_type

The mime-type of the request body content (e.g. text/plain; charset=utf-8).

◆ content_type_length

size_t glitchedhttps_request::content_type_length

content_type string length.

◆ method

enum glitchedhttps_method glitchedhttps_request::method

The request's HTTP method (E.g. GET, POST, ...).

Please remember that only POST, PUT and PATCH requests should send a request body (via content parameter here).

◆ ssl_verification_optional

int glitchedhttps_request::ssl_verification_optional

SET THIS TO FALSE!

It's best to leave this set to 0.

Only set this to 1 if you don't want to enforce verification of the server's SSL certificate (DEFINITIVELY NOT RECOMMENDED FOR PRODUCTION ENV!).

This value is only taken into consideration in case of an HTTPS request (determined by the scheme defined in the url). Plain HTTP requests ignore this setting.

◆ url

char* glitchedhttps_request::url

The full, uncensored URL for the HTTP POST request including protocol, host name, port (optional), resource URI and query parameters (if any).

◆ url_length

size_t glitchedhttps_request::url_length

url string length.


The documentation for this struct was generated from the following file: