fuchsia.net.oldhttp

PROTOCOLS

HttpService

Defined in fuchsia.net.oldhttp/http_service.fidl

CreateURLLoader

Request

NameType
loader request<URLLoader>

URLLoader

Defined in fuchsia.net.oldhttp/url_loader.fidl

Start

Loads the given request, asynchronously producing response. Consult response to determine if the request resulted in an error, was redirected, or has a response body to be consumed.

Request

NameType
request URLRequest

Response

NameType
response URLResponse

FollowRedirect

If the request passed to Start had auto_follow_redirects set to false, then upon receiving an URLResponse with a non-NULL redirect_url field, FollowRedirect may be called to load the URL indicated by the redirect.

Request

NameType

Response

NameType
response URLResponse

QueryStatus

Query status about the URLLoader.

Request

NameType

Response

NameType
status URLLoaderStatus

STRUCTS

HttpError

Defined in fuchsia.net.oldhttp/http_error.fidl

NameTypeDescriptionDefault
code int32 No default
description string? No default

HttpHeader

Defined in fuchsia.net.oldhttp/http_header.fidl

NameTypeDescriptionDefault
name string No default
value string No default

URLLoaderStatus

Defined in fuchsia.net.oldhttp/url_loader.fidl

NameTypeDescriptionDefault
error HttpError? If the loader has failed due to a network level error, this field will be set. No default
is_loading bool Set to true if the URLLoader is still working. Set to false once an error is encountered or the response body is completely copied to the response body stream. No default

URLRequest

Defined in fuchsia.net.oldhttp/url_request.fidl

NameTypeDescriptionDefault
url string The URL to load. No default
method string The HTTP method if applicable. GET
headers vector<HttpHeader>? Additional HTTP request headers. No default
body URLBody? The payload for the request body. For HTTP requests, the method must be set to "POST" or "PUT". If a buffer is used for the body, a Content-Length header will automatically be added. No default
response_body_buffer_size uint32 The buffer size of the socket returned in URLResponse's `body` member. A value of 0 indicates that the default buffer size should be used. This value is just a suggestion. The URLLoader may choose to ignore this value. 0
auto_follow_redirects bool If set to true, then redirects will be automatically followed. Otherwise, when a redirect is encounterd, FollowRedirect must be called to proceed. false
cache_mode CacheMode The cache behavior for the request. CacheMode.DEFAULT
response_body_mode ResponseBodyMode The response body mode. ResponseBodyMode.STREAM

URLResponse

Defined in fuchsia.net.oldhttp/url_response.fidl

NameTypeDescriptionDefault
error HttpError? If the response resulted in a network level error, this field will be set. No default
body URLBody? The response body. No default
url string? The final URL of the response, after redirects have been followed. No default
status_code uint32 The HTTP status code. 0 if not applicable. No default
status_line string? The HTTP status line. No default
headers vector<HttpHeader>? The HTTP response headers. No default
mime_type string? The MIME type of the response body. No default
charset string? The character set of the response body. No default
redirect_method string? These fields are set to non-NULL if this response corresponds to a redirect. Call the `FollowRedirect` method on the URLLoader instance to follow this redirect. No default
redirect_url string? No default
redirect_referrer string? No default

ENUMS

CacheMode

Type: uint32

Defined in fuchsia.net.oldhttp/url_request.fidl

Specify the cache behavior of the request.

NameValueDescription
DEFAULT 0 Default behavior.
BYPASS_CACHE 1 The HTTP request will bypass the local cache and will have a 'Cache-Control: nocache' header added in that causes any proxy servers to also not satisfy the request from their cache. This has the effect of forcing a full end-to-end fetch.
ONLY_FROM_CACHE 2 The HTTP request will fail if it cannot serve the requested resource from the cache (or some equivalent local store).

ResponseBodyMode

Type: uint32

Defined in fuchsia.net.oldhttp/url_request.fidl

Specify the mechanism used to return the response body.

NameValueDescription
BUFFER 0 The complete response body should be returned in the `buffer` field of the response body.
STREAM 1 The response body should be streamed through the `stream` field of the response body.
BUFFER_OR_STREAM 2 The response body may be returned as a buffer or stream.

UNIONS

URLBody

Defined in fuchsia.net.oldhttp/url_body.fidl

NameTypeDescription
stream handle<socket> A socket that will contain the streaming request or response body.
buffer fuchsia.mem/Buffer A shared buffer that will contain the complete request or response body.