-
Notifications
You must be signed in to change notification settings - Fork 260
HTTPProtocol
The metadata
argument to HTTPProtocol.getProtocolOutput() can affect the behavior of the protocol. The following metadata keys are detected by HTTPProtocol
implementations and utilized in performing the request:
-
last-modified
: If this key is present inmetadata
, the protocol will use the metadata value as the date for theIf-Modified-Since
header field of the HTTP request. If the key is not present, theIf-Modified-Since
field won't be added to the request header. -
protocol.etag
: If this key is present inmetadata
, the protocol will use the metadata value as the ETag for theIf-None-Match
header field of the HTTP request. If the key is not present, theIf-None-Match
field won't be added to the request header. -
http.accept
: If this key is present inmetadata
, the protocol will use the value to override the value for theAccept
header field of the HTTP request. If the key is not present, thehttp.accept
global configuration value is used instead. (Available in v1.11+) -
http.accept.language
: If this key is present inmetadata
, the protocol will use the value to override the value for theAccept-Language
header field of the HTTP request. If the key is not present, thehttp.accept.language
global configuration value is used instead. (Available in v1.11+) -
protocol.set-cookie
: If this key is present inmetadata
andhttp.use.cookies
is true, the protocol will sent cookies stored from the response this page was linked to given the cookie is applicable to the domain of the link. -
http.method.head
: If this key is present inmetadata
, the protocol sends a HEAD request. (Available in v1.12+ only for httpclient, see #485) -
http.post.json
: If this key is present inmetadata
, the protocol sends a POST request. (Available in v1.12+ only for okhttp, see #641) -
protocol.set-headers
: If this key is present in metadata, the protocol add the specified headers to the request. See #993
Md example :
"protocol%2Eset-header": [
"header1=value1",
"header2=value2"
]
Notes:
- metadata values starting with
protocol.
may start with a different prefix instead, seeprotocol.md.prefix
and #776 - metadata used for requests needs to be persisted, e.g.
metadata.persist: - last-modified - protocol.etag - protocol.set-cookie - ...
- cookies need to be transferred to outlinks by setting
metadata.transfer: - set-cookie
- Start
- Components
- Filters
- Bolts
- Protocol
- Metadata
- Resources