Using the configuration property requestHeaders, you can set request headers for all outgoing HTTP connections of PDFreactor, used to load the document and its resources like images and style sheets. Similarly you can set cookies using the configuration property cookies.
Both expect a key-value-pair as parameters and can be called multiple times to set multiple headers or cookies. Existing keys will be overwritten.
Java
config.setRequestHeaders(new KeyValuePair("User-Agent", "PDFreactor")); config.setCookies(new KeyValuePair("name", "Peter"));
C#
config.RequestHeaders = new List<KeyValuePair> { new KeyValuePair("User-Agent", "PDFreactor") }; config.Cookies = new List<KeyValuePair> { new KeyValuePair("name", "Peter") };
PHP
$config["requestHeaders"] = array(array( "key" => "User-Agent", "value" => "PDFreactor" )); $config["cookies"] = array(array( "key" => "name", "value"=> "Peter" ));
JavaScript/Node.js
config.requestHeaders = [{ key: "User-Agent", value: "PDFreactor" }]; config.cookies = [{ key: "name", value: "Peter" }];
Python
config["requestHeaders"] = [{ "key": "User-Agent", "value": "PDFreactor" }] config["cookies"] = [{ "key": "name", "value": "Peter" }]
Ruby
config["requestHeaders"] = [{ key: "User-Agent", value: "PDFreactor" }] config["cookies"] = [{ key: "name", value: "Peter" }]
Perl
$config["requestHeaders"] = [{ "key" => "User-Agent", "value" => "PDFreactor" }]; $config["cookies"] = [{ "key" => "name", "value"=> "Peter" }];
REST
{ "requestHeaders": [{ "key": "User-Agent", "value": "PDFreactor" }], "cookies": [{ "key": "name", "value": "Peter" }]}
This functionality can be used to pass a session ID from the integration to PDFreactor.