-
Notifications
You must be signed in to change notification settings - Fork 268
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-Sinceheader field of the HTTP request. If the key is not present, theIf-Modified-Sincefield 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-Matchheader field of the HTTP request. If the key is not present, theIf-None-Matchfield 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 theAcceptheader field of the HTTP request. If the key is not present, thehttp.acceptglobal 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-Languageheader field of the HTTP request. If the key is not present, thehttp.accept.languageglobal configuration value is used instead. (Available in v1.11+) -
protocol.set-cookie: If this key is present inmetadataandhttp.use.cookiesis 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.prefixand #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