PROTOCOLS
HttpService
Defined in fuchsia.net.oldhttp/http_service.fidl
CreateURLLoader
Request
Name | Type |
---|---|
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
Name | Type |
---|---|
request |
URLRequest
|
Response
Name | Type |
---|---|
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
Name | Type |
---|
Response
Name | Type |
---|---|
response |
URLResponse
|
QueryStatus
Query status about the URLLoader.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
status |
URLLoaderStatus
|
STRUCTS
HttpError
Defined in fuchsia.net.oldhttp/http_error.fidl
Name | Type | Description | Default |
---|---|---|---|
code |
int32
|
No default | |
description |
string?
|
No default |
HttpHeader
Defined in fuchsia.net.oldhttp/http_header.fidl
Name | Type | Description | Default |
---|---|---|---|
name |
string
|
No default | |
value |
string
|
No default |
URLLoaderStatus
Defined in fuchsia.net.oldhttp/url_loader.fidl
Name | Type | Description | Default |
---|---|---|---|
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
Name | Type | Description | Default |
---|---|---|---|
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 |
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
Name | Type | Description | Default |
---|---|---|---|
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 |
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.
Name | Value | Description |
---|---|---|
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.
Name | Value | Description |
---|---|---|
BUFFER |
0 |
The complete response body should be returned in the |
STREAM |
1 |
The response body should be streamed through the |
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
Name | Type | Description |
---|---|---|
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. |