OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module mojo; | 5 module mojo; |
6 | 6 |
7 import "mojo/services/network/public/interfaces/network_error.mojom"; | 7 import "mojo/services/network/public/interfaces/network_error.mojom"; |
8 | 8 |
9 struct URLRequest { | 9 struct URLRequest { |
10 // The URL to load. | 10 // The URL to load. |
11 string url; | 11 string url; |
12 | 12 |
13 // The HTTP method if applicable. | 13 // The HTTP method if applicable. |
14 string method = "GET"; | 14 string method = "GET"; |
15 | 15 |
16 // Additional HTTP request headers. | 16 // Additional HTTP request headers. |
17 array<string>? headers; | 17 array<string>? headers; |
18 | 18 |
19 // The payload for the request body, represented as a concatenation of data | 19 // The payload for the request body, represented as a concatenation of data |
20 // streams. For HTTP requests, the method must be set to "POST" or "PUT". | 20 // streams. For HTTP requests, the method must be set to "POST" or "PUT". |
21 array<handle<data_pipe_consumer>>? body; | 21 array<handle<data_pipe_consumer>>? body; |
22 | 22 |
23 // The number of bytes to be read from |body|. A Content-Length header of | |
24 // this value will be sent. Set to -1 if length is unknown, which will cause | |
25 // |body| to be uploaded using a chunked encoding. | |
26 int64 body_length = 0; | |
27 | |
28 // The buffer size of the data pipe returned in URLResponse's |body| member. | 23 // The buffer size of the data pipe returned in URLResponse's |body| member. |
29 // A value of 0 indicates that the default buffer size should be used. This | 24 // A value of 0 indicates that the default buffer size should be used. This |
30 // value is just a suggestion. The URLLoader may choose to ignore this value. | 25 // value is just a suggestion. The URLLoader may choose to ignore this value. |
31 uint32 response_body_buffer_size = 0; | 26 uint32 response_body_buffer_size = 0; |
32 | 27 |
33 // If set to true, then redirects will be automatically followed. Otherwise, | 28 // If set to true, then redirects will be automatically followed. Otherwise, |
34 // when a redirect is encounterd, FollowRedirect must be called to proceed. | 29 // when a redirect is encounterd, FollowRedirect must be called to proceed. |
35 bool auto_follow_redirects = false; | 30 bool auto_follow_redirects = false; |
36 | 31 |
37 // If set to true, then the HTTP request will bypass the local cache and will | 32 // If set to true, then the HTTP request will bypass the local cache and will |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 Start(URLRequest request) => (URLResponse response); | 90 Start(URLRequest request) => (URLResponse response); |
96 | 91 |
97 // If the request passed to |Start| had |auto_follow_redirects| set to false, | 92 // If the request passed to |Start| had |auto_follow_redirects| set to false, |
98 // then upon receiving an URLResponse with a non-NULL |redirect_url| field, | 93 // then upon receiving an URLResponse with a non-NULL |redirect_url| field, |
99 // |FollowRedirect| may be called to load the URL indicated by the redirect. | 94 // |FollowRedirect| may be called to load the URL indicated by the redirect. |
100 FollowRedirect() => (URLResponse response); | 95 FollowRedirect() => (URLResponse response); |
101 | 96 |
102 // Query status about the URLLoader. | 97 // Query status about the URLLoader. |
103 QueryStatus() => (URLLoaderStatus status); | 98 QueryStatus() => (URLLoaderStatus status); |
104 }; | 99 }; |
OLD | NEW |