Dear expert,
I'm trying to simulate a web request to download a PDF from iThenticate (plagiarism detection service, Plagiarism Detection Software | iThenticate).
Therefore I need to set a cookie with a session ID (see code below) in my request (UTL_HTTP).
Since I always get the JSON respond '{"error":"Please log in"}' I know I do something wrong.
What do you think about the code below? Is it ok to set the cookie via SET_HEADER?
From the following request I should get back an URL to the plagiat report (but as I mentioned I get "Pleas log in"):
l_url := 'https://api.ithenticate.com/paper/' || l_iThenticateFileID || '/queue_pdf?%26lang=en_us%26output=json';
l_http_request := UTL_HTTP.begin_request (l_url, 'POST', ' HTTP/1.1');
UTL_HTTP.set_header (l_http_request, 'Host', 'api.ithenticate.com');
UTL_HTTP.set_header (l_http_request, 'User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0');
UTL_HTTP.set_header (l_http_request, 'X-Requested-With', 'XMLHttpRequest');
UTL_HTTP.set_header (l_http_request, 'content-type', 'application/json; charset=UTF-8');
UTL_HTTP.set_header (l_http_request, 'Referer', 'https://api.ithenticate.com/ithenticate_dv?lang=en_us%26o=' || l_iThenticateFileID);
UTL_HTTP.set_header (l_http_request, 'Content-Length', length(l_content));
UTL_HTTP.set_header (l_http_request, 'Cookie', 'use_text=0; _ga=GA1.2.1234567890.123456789; ithenticate_session=9c6933a4dfb5199281d75612531cf212b8183f21'); --' || l_sid );
UTL_HTTP.set_header (l_http_request, 'Connection', 'keep-alive');
UTL_HTTP.write_text (l_http_request, '{"as":1,"or_type":"similarity"}');
l_http_response := UTL_HTTP.get_response (l_http_request);
Thanks for any hint,
rrr