Skip to content

http:send-request cookie handling enhancements #2733

Description

@apb2006

Mail list discussion

Scripting access to web sites often requires sending cookies received in earlier responses. Currently this is hard to do, particularly when redirections are involved.

XProc 3.1 has features in it's p:http-request step that make this easier. Expressed as http:send-request features they could be summarised as:

  • The http:send-request step automatically parses incoming Set-Cookie headers from responses and sends matching cookies back in subsequent requests within the same context or XQuery execution.

  • You can control or disable automatic cookie tracking by setting a new attribute @suppress-cookies set to true or false on the <http:request> element.

Additionally p:http-request supplies @follow-redirects as an integer rather than boolean allowing greater control.

Implementations of this feature can be seen in:

  1. The Kotlin source of XMLCalabash 3 here
  2. The earlier cookie-jar extension to XML Calabash 1 in Java here

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions