Demonstrates winyl_change_http.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]) {
printf(
"Error code %d\n", host.
error);
exit(1);
}
printf(
"Error code %d\n", res.
error);
exit(1);
}
printf("See notes in the example's code!\n");
printf(
"%s\n", res.
body);
exit(0);
}
Contains the winyl_request function and related.
#define WINYL_REQUEST_NO_HEADERS
Skips parsing the headers.
Definition request.h:42
void winyl_response_close(winyl_response *response)
Frees memory used up by response.
winyl_response winyl_request(winyl *host, char *path, int flags)
Performs a HTTP request.
Represents a HTTP response.
Definition request.h:13
int error
Contains the error code after any winyl call.
Definition request.h:15
char * body
Response body.
Definition request.h:34
Represents a HTTP host.
Definition winyl.h:27
int error
Contains the error code after any winyl call.
Definition winyl.h:29
Contains the winyl_open function and related.
void winyl_close(winyl *host)
Frees memory used up by host.
#define WINYL_HTTP_1_0
HTTP/1.0 for winyl_change_http.
Definition winyl.h:18
winyl winyl_open(char *hostname, int port)
Opens an HTTP host with the specified port.
int winyl_change_http(winyl *host, int version)
Changes HTTP version used for requests to host.