Project: /_project.yaml Book: /_book.yaml

fuchsia.net.http

PROTOCOLS

Loader {:#Loader}

Defined in fuchsia.net.http/client.fidl

An HTTP loader.

The loader can service many HTTP requests concurrently. The loader tracks all the outstanding requests and will cancel them all if the client closes the loader interface.

Fetch {:#Fetch}

Initiate the given HTTP request, follow redirects, and return the final response.

The loader will follow redirects (up to an implementation-defined limit) and return the final response as a reply to this message. To cancel the request, either close the loader interface or close the peer to the event included in the request.

Request

Response

Start {:#Start}

Initiate the given HTTP request and return all intermediate responses to the given client.

Unlike Fetch, Start does not automatically follow all redirects. Instead, each individual response along the redirect chain is delivered to the LoaderClient.

Request

LoaderClient {:#LoaderClient}

Defined in fuchsia.net.http/client.fidl

A client interface used with Loader.Start.

Closing the underlying channel will cancel the associated HTTP transaction.

OnResponse {:#OnResponse}

Called by the loader when the loader receives an HTTP response.

If the server has requested a redirect, then redirect will be non-null and describe the target the server requested. To follow the redirect, reply to this message. To not follow the redirect, close the underlying channel.

Request

Response

Loader {:#Loader}

Defined in fuchsia.net.http/client.fidl

An HTTP loader.

The loader can service many HTTP requests concurrently. The loader tracks all the outstanding requests and will cancel them all if the client closes the loader interface.

Fetch {:#Fetch}

Initiate the given HTTP request, follow redirects, and return the final response.

The loader will follow redirects (up to an implementation-defined limit) and return the final response as a reply to this message. To cancel the request, either close the loader interface or close the peer to the event included in the request.

Request

Response

Start {:#Start}

Initiate the given HTTP request and return all intermediate responses to the given client.

Unlike Fetch, Start does not automatically follow all redirects. Instead, each individual response along the redirect chain is delivered to the LoaderClient.

Request

LoaderClient {:#LoaderClient}

Defined in fuchsia.net.http/client.fidl

A client interface used with Loader.Start.

Closing the underlying channel will cancel the associated HTTP transaction.

OnResponse {:#OnResponse}

Called by the loader when the loader receives an HTTP response.

If the server has requested a redirect, then redirect will be non-null and describe the target the server requested. To follow the redirect, reply to this message. To not follow the redirect, close the underlying channel.

Request

Response

STRUCTS

Error {:#Error}

Defined in fuchsia.net.http/client.fidl

An error occurred during the HTTP transaction.

These error codes correspond to https://fuchsia.googlesource.com/fuchsia/+/master/garnet/bin/network/net_error_list.h

Header {:#Header}

Defined in fuchsia.net.http/client.fidl

An HTTP header field.

Request {:#Request}

Defined in fuchsia.net.http/client.fidl

An HTTP request.

When this happens, the loader will send a Response with the appropriate error code.

RedirectTarget {:#RedirectTarget}

Defined in fuchsia.net.http/client.fidl

A description of the redirect the server requested.

The semantics of an HTTP redirect vary according to the status code use to generate the redirect. This structure ensures that the loader and its client agree on the interpretation of the redirect response from the server.

Response {:#Response}

Defined in fuchsia.net.http/client.fidl

A response to an HTTP request.

0 if not applicable.

Error {:#Error}

Defined in fuchsia.net.http/client.fidl

An error occurred during the HTTP transaction.

These error codes correspond to https://fuchsia.googlesource.com/fuchsia/+/master/garnet/bin/network/net_error_list.h

Header {:#Header}

Defined in fuchsia.net.http/client.fidl

An HTTP header field.

Request {:#Request}

Defined in fuchsia.net.http/client.fidl

An HTTP request.

When this happens, the loader will send a Response with the appropriate error code.

RedirectTarget {:#RedirectTarget}

Defined in fuchsia.net.http/client.fidl

A description of the redirect the server requested.

The semantics of an HTTP redirect vary according to the status code use to generate the redirect. This structure ensures that the loader and its client agree on the interpretation of the redirect response from the server.

Response {:#Response}

Defined in fuchsia.net.http/client.fidl

A response to an HTTP request.

0 if not applicable.

ENUMS

CacheMode {:#CacheMode}

Type: uint32

Defined in fuchsia.net.http/client.fidl

Specify the cache behavior of the request.

ResponseBodyMode {:#ResponseBodyMode}

Type: uint32

Defined in fuchsia.net.http/client.fidl

Specify the mechanism used to return the response body.

Streaming the response can be more efficient if the response body is large and can be processed incrementally (e.g., by an image decoder).

Buffering the response can be more efficient if the response body is in cache and the cache entry can be directly mapped into the resulting buffer.

The loader MAY abort the transation if the buffer size exceeds an implementation-defined limit.

CacheMode {:#CacheMode}

Type: uint32

Defined in fuchsia.net.http/client.fidl

Specify the cache behavior of the request.

ResponseBodyMode {:#ResponseBodyMode}

Type: uint32

Defined in fuchsia.net.http/client.fidl

Specify the mechanism used to return the response body.

Streaming the response can be more efficient if the response body is large and can be processed incrementally (e.g., by an image decoder).

Buffering the response can be more efficient if the response body is in cache and the cache entry can be directly mapped into the resulting buffer.

The loader MAY abort the transation if the buffer size exceeds an implementation-defined limit.

UNIONS

Body {:#Body}

Defined in fuchsia.net.http/client.fidl

The body of either an HTTP request or an HTTP response.

Body {:#Body}

Defined in fuchsia.net.http/client.fidl

The body of either an HTTP request or an HTTP response.