Using Cookies for REST/HTTP Calls

Some websites require cookies to access certain corners:

When visting a page (the first time), the generated cookie can be read out with the response_header field:

The response_header might look something like this:

The cookie can be read out using the json-path “$.Set-Cookie”

To use the Cookie again it should be added as Header to any HTTP/Rest call, using the header name “Cookie”

Create URL for REST-query

When you want to query a REST API but have values that need url-encoding first, you can use a User Defined Java Expression:

Transformation with three steps:
Generate Rows
User Defined Java Expression
REST query
Generate URL to query Crossref REST API (Download: Transformation)

In this particular example it is necessary as PDI would throw the error (“Illegal character in path”) if you query the following URL unmodified from a string: