OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 [DartPackage="mojo"] | |
6 module mojo; | |
7 | |
8 import "mojo/public/interfaces/network/http_header.mojom"; | |
9 | |
10 struct URLRequest { | |
11 // Specify the cache behavior of the request. | |
12 enum CacheMode { | |
13 // Default behavior. | |
14 DEFAULT, | |
15 | |
16 // The HTTP request will bypass the local cache and will have a | |
17 // 'Cache-Control: nocache' header added in that causes any proxy servers | |
18 // to also not satisfy the request from their cache. This has the effect | |
19 // of forcing a full end-to-end fetch. | |
20 BYPASS_CACHE, | |
21 | |
22 // The HTTP request will fail if it cannot serve the requested resource | |
23 // from the cache (or some equivalent local store). | |
24 ONLY_FROM_CACHE, | |
25 }; | |
26 | |
27 // The URL to load. | |
28 string url; | |
29 | |
30 // The HTTP method if applicable. | |
31 string method = "GET"; | |
32 | |
33 // Additional HTTP request headers. | |
34 array<HttpHeader>? headers; | |
35 | |
36 // The payload for the request body, represented as a concatenation of data | |
37 // streams. For HTTP requests, the method must be set to "POST" or "PUT". | |
38 array<handle<data_pipe_consumer>>? body; | |
39 | |
40 // The buffer size of the data pipe returned in URLResponse's |body| member. | |
41 // A value of 0 indicates that the default buffer size should be used. This | |
42 // value is just a suggestion. The URLLoader may choose to ignore this value. | |
43 uint32 response_body_buffer_size = 0; | |
44 | |
45 // If set to true, then redirects will be automatically followed. Otherwise, | |
46 // when a redirect is encounterd, FollowRedirect must be called to proceed. | |
47 bool auto_follow_redirects = false; | |
48 | |
49 // The cache behavior for the request. | |
50 CacheMode cache_mode = DEFAULT; | |
51 }; | |
OLD | NEW |