ae.net.http.common

Concepts shared between HTTP clients and servers.

Members

Aliases

UrlParameters (from ae.net.ietf.url)
alias UrlParameters = MultiAA!(string, string) via public import ae.net.ietf.url : UrlParameters, encodeUrlParameter, encodeUrlParameters, decodeUrlParameter, decodeUrlParameters;

Type to hold decoded URL query string parameters.

encodeUrlParameter (from ae.net.ietf.url)
alias encodeUrlParameter = encodeUrlPart!(c => isAlphaNum(c) || c == '-' || c == '_') via public import ae.net.ietf.url : UrlParameters, encodeUrlParameter, encodeUrlParameters, decodeUrlParameter, decodeUrlParameters;

Encode a URL parameter, escaping all non-alpha-numeric characters except '-' and '_'.

Classes

HttpRequest
class HttpRequest

HTTP request class

HttpResponse
class HttpResponse

HTTP reply class

Enums

HttpStatusCode
enum HttpStatusCode

HTTP response status codes

Functions

cacheForever
void cacheForever(Headers headers)

Sets headers to request clients to cache a response indefinitely.

decodeMultipart
MultipartPart[] decodeMultipart(Data data, string boundary)

Decode a multipart body using the given boundary.

decodeUrlParameter (from ae.net.ietf.url)
string decodeUrlParameter(string encoded) via public import ae.net.ietf.url : UrlParameters, encodeUrlParameter, encodeUrlParameters, decodeUrlParameter, decodeUrlParameters;

Decodes a single URL parameter.

decodeUrlParameters (from ae.net.ietf.url)
UrlParameters decodeUrlParameters(string qs) via public import ae.net.ietf.url : UrlParameters, encodeUrlParameter, encodeUrlParameters, decodeUrlParameter, decodeUrlParameters;

Decodes URL parameters from a query string. (Do not include the leading '?').

disableCache
void disableCache(Headers headers)

Sets headers to request clients to not cache a response.

encodeMultipart
Data encodeMultipart(MultipartPart[] parts, string boundary)

Encode a multipart body with the given parts and boundary.

encodeUrlParameters (from ae.net.ietf.url)
string encodeUrlParameters(string[string] dic) via public import ae.net.ietf.url : UrlParameters, encodeUrlParameter, encodeUrlParameters, decodeUrlParameter, decodeUrlParameters;
Undocumented in source.
httpEscape
deprecated string httpEscape(string str)
Undocumented in source. Be warned that the author may not have intended to support it.
httpTime
string httpTime(SysTime time)

Formats a timestamp in the format used by HTTP (RFC 2822).

parseItemList
string[] parseItemList(string s)

Parses a list in the format of "a, b, c;q=0.5, d" and returns an array of items sorted by "q" (["a", "b", "d", "c"])

Structs

MultipartPart
struct MultipartPart

Represents a part from a multipart/* message.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Stéphan Kochen <stephan@kochen.nl> Vladimir Panteleev <ae@cy.md> Simon Arlott