The different request types supported by evhttp. These are as specified in RFC2616, except for PATCH which is specified by RFC5789.
a request object can represent either a request or a reply
Makes an HTTP server accept connections on the specified socket.
Like evhttp_accept_socket(), but returns a handle for referencing the socket.
Adds a header to a list of existing headers.
Add a server alias to an http object. The http object can be a virtual host or the main server.
Adds a virtual host to the http server.
The most low-level evhttp_bind/accept method: takes an evconnlistener, and returns an evhttp_bound_socket. The listener will be freed when the bound socket is freed.
Binds an HTTP server on the specified address and port.
Like evhttp_bind_socket(), but returns a handle for referencing the socket.
Get the raw file descriptor referenced by an evhttp_bound_socket.
Return the listener used to implement a bound socket.
Cancels a pending HTTP request.
Removes all headers from the header list.
A connection object that can be used to for making HTTP requests. The connection object tries to resolve address and establish the connection when it is given an http request object.
Frees an http connection
Returns the underlying event_base for this connection
Get the remote address and port associated with this connection.
Set a callback for connection close.
sets the ip address from which http connections are made
sets the local port from which http connections are made
Sets the retry limit for this connection - -1 repeats indefinitely
Sets the timeout for events related to this connection
Helper function to sort of decode a URI-encoded string. Unlike evhttp_get_decoded_uri, it decodes all plus characters that appear _after_ the first question mark character, but no plusses that occur before. This is not a good way to decode URIs in whole or in part.
Makes an HTTP server stop accepting connections on the specified socket
Removes the callback for a specified URI
Helper function to encode a string for inclusion in a URI. All characters are replaced by their hex-escaped (%22) equivalents, except for characters explicitly unreserved by RFC3986 -- that is, ASCII alphanumeric characters, hyphen, dot, underscore, and tilde.
Finds the value belonging to a header.
Free the previously created HTTP server.
Escape HTML character entities in a string.
Make an HTTP request over the specified connection.
Create a new HTTP server.
Helper function to parse out arguments in a query.
Helper function to parse out arguments from the query portion of an HTTP URI.
Removes a header from a list of existing headers.
Remove a server alias from an http object.
Removes a virtual host from the http server.
Frees the request object and removes associated events.
Returns the request command
Returns the connection object associated with the request or NULL
Returns the request URI (parsed)
Returns the host associated with the request. If a client sends an absolute URI, the host part of that is preferred. Otherwise, the input headers are searched for a Host: header. NULL is returned if no absolute URI or Host: header is provided.
Returns the input buffer
Returns the input headers
Returns the output buffer
Returns the output headers
Returns the request URI
Returns 1 if the request is owned by the user
Creates a new request object that needs to be filled in with the request parameters. The callback is executed when the request completed or an error occurred.
Takes ownership of the request object
Enable delivery of chunks to requestor. @param cb will be called after every read of data with the same argument as the completion callback. Will never be called on an empty response. May drain the input buffer; it will be drained automatically on return.
Send an HTML error message to the client.
Send an HTML reply to the client.
Send another data chunk as part of an ongoing chunked reply.
Complete a chunked reply, freeing the request as appropriate.
Initiate a reply that uses Transfer-Encoding chunked.
Sets the what HTTP methods are supported in requests accepted by this server, and passed to user callbacks.
Set a callback for a specified URI
Set a callback for all requests that are not caught by specific callbacks
XXX Document.
XXX Document.
Set the timeout for an HTTP request.
Free all memory allocated for a parsed uri. Only use this for URIs generated by evhttp_uri_parse.
Return the fragment part of an evhttp_uri (excluding the leading "#"), * or NULL if it has no fragment set
Return the host part of an evhttp_uri, or NULL if it has no host set. The host may either be a regular hostname (conforming to the RFC 3986 "regname" production), or an IPv4 address, or the empty string, or a bracketed IPv6 address, or a bracketed 'IP-Future' address.
Return the path part of an evhttp_uri, or NULL if it has no path set
Return the port part of an evhttp_uri, or -1 if there is no port set.
Return the query part of an evhttp_uri (excluding the leading "?"), or * NULL if it has no query set
Return the scheme of an evhttp_uri, or NULL if there is no scheme has * been set and the evhttp_uri contains a Relative-Ref.
Return the userinfo part of an evhttp_uri, or NULL if it has no userinfo set.
Join together the uri parts from parsed data to form a URI-Reference.
Return a new empty evhttp_uri with no fields set.
Alias for evhttp_uri_parse_with_flags(source_uri, 0)
Helper function to parse a URI-Reference as specified by RFC3986.
Changes the flags set on a given URI. See EVHTTP_URI_* for a list of flags.
Set the fragment of an evhttp_uri, or clear the fragment if fragment==NULL. * The fragment should not include a leading "#". * Returns 0 on success, -1 if fragment is not well-formed.
Set the host of an evhttp_uri, or clear the host if host==NULL. * Returns 0 on success, -1 if host is not well-formed.
Set the path of an evhttp_uri, or clear the path if path==NULL. * Returns 0 on success, -1 if path is not well-formed.
Set the port of an evhttp_uri, or clear the port if port==-1. * Returns 0 on success, -1 if port is not well-formed.
Set the query of an evhttp_uri, or clear the query if query==NULL. * The query should not include a leading "?". * Returns 0 on success, -1 if query is not well-formed.
Set the scheme of an evhttp_uri, or clear the scheme if scheme==NULL. * Returns 0 on success, -1 if scheme is not well-formed.
Set the userinfo of an evhttp_uri, or clear the userinfo if userinfo==NULL. * Returns 0 on success, -1 if userinfo is not well-formed.
Helper function to decode a URI-escaped string or HTTP parameter.
As evhttp_encode_uri, but if 'size' is nonnegative, treat the string as being 'size' bytes long. This allows you to encode strings that may contain 0-valued bytes.
Tolerate URIs that do not conform to RFC3986.
< method not allowed for this uri
< invalid http request was made
<
< we can't handle this expectation
< internal error
< the uri moved permanently
< the uri moved temporarily
< request does not have content
< could not find content for uri
< not implemented
< page was not modified from last
@file event2/http.h * * Basic support for HTTP serving. * * As Libevent is a library for dealing with event notification and most * interesting applications are networked today, I have often found the * need to write HTTP code. The following prototypes and definitions provide * an application with a minimal interface for making HTTP requests and for * creating a very simple HTTP server. *//**< request completed ok
< the server is not available
A structure to hold a parsed URI or Relative-Ref conforming to RFC3986.