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:
- The Kotlin source of XMLCalabash 3 here
- The earlier cookie-jar extension to XML Calabash 1 in Java here
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-requeststep that make this easier. Expressed ashttp:send-requestfeatures they could be summarised as:The
http:send-requeststep automatically parses incomingSet-Cookieheaders 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-cookiesset to true or false on the<http:request>element.Additionally
p:http-requestsupplies@follow-redirectsas an integer rather than boolean allowing greater control.Implementations of this feature can be seen in: