<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HTTP POST and GET using authentication cookie in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-and-get-using-authentication-cookie/m-p/7577170#M1565990</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the answer.  check out note 1160362.  Basically, you need to set parameter ict/disable_cookie_urlencoding = 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Jan 2011 02:25:10 GMT</pubDate>
    <dc:creator>tony_raimo2</dc:creator>
    <dc:date>2011-01-31T02:25:10Z</dc:date>
    <item>
      <title>HTTP POST and GET using authentication cookie</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-and-get-using-authentication-cookie/m-p/7577169#M1565989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to post data to a URL, but first I need to authenticate.  The steps are as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTTP POST to &lt;A href="https://www.xxxx.com/LOGIN" target="test_blank"&gt;https://www.xxxx.com/LOGIN&lt;/A&gt; passing username and password&lt;/P&gt;&lt;P&gt;Get cookie that is passed back&lt;/P&gt;&lt;P&gt;HTTP GET from  &lt;A href="https://www.xxxx.com/LOGIN" target="test_blank"&gt;https://www.xxxx.com/LOGIN&lt;/A&gt; &lt;STRONG&gt;using auth cookie&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;HTTP POST to &lt;A href="https://www.xxxx.com/postdata.aspx" target="test_blank"&gt;https://www.xxxx.com/postdata.aspx&lt;/A&gt; &lt;STRONG&gt;using auth cookie&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can capture the auth cookie that is returned in the first post using &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;http_client-&amp;gt;PROPERTYTYPE_ACCEPT_COOKIE =  http_client-&amp;gt;CO_ENABLED .&lt;/P&gt;&lt;P&gt;CALL METHOD: http_client-&amp;gt;response-&amp;gt;get_cookies( changing cookies = lt_cookies ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I pass the cookie to the next POST like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at lt_cookies into ls_cookies.&lt;/P&gt;&lt;P&gt;    CALL METHOD http_client-&amp;gt;request-&amp;gt;SET_COOKIE&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    NAME     = ls_cookies-name&lt;/P&gt;&lt;P&gt;    PATH     = ls_cookies-path&lt;/P&gt;&lt;P&gt;    VALUE    = ls_cookies-value&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       DOMAIN   = ls_cookies-xdomain&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    EXPIRES  = ls_cookies-expires&lt;/P&gt;&lt;P&gt;    SECURE   = ls_cookies-secure.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I see happening in the ICM logs is that the cookie value that I get back from the first call is NOT URL Encoded.  However, when I pass the cookie to the next request the cookie is URL encoded and the POST fails with a 403 errror.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the cookie value returned in first call:&lt;/P&gt;&lt;P&gt;erptest:2011-01-29-15-22-21:2011-01-30-15-22-21::7da37b826abd4f86dcf9ac5e5304b880:1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the cookie value passed to the next call:&lt;/P&gt;&lt;P&gt;erptest%3a2011-01-29-15-22-21%3a2011-01-30-15-22-21%3a%3a7da37b826abd4f86dcf9ac5e5304b880%3a1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anybody know how to properly pass a cookie to a POST without it being URL encoded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tony Raimo on Jan 29, 2011 9:55 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tony Raimo on Jan 29, 2011 10:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jan 2011 19:22:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-and-get-using-authentication-cookie/m-p/7577169#M1565989</guid>
      <dc:creator>tony_raimo2</dc:creator>
      <dc:date>2011-01-29T19:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP POST and GET using authentication cookie</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-and-get-using-authentication-cookie/m-p/7577170#M1565990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the answer.  check out note 1160362.  Basically, you need to set parameter ict/disable_cookie_urlencoding = 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jan 2011 02:25:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-and-get-using-authentication-cookie/m-p/7577170#M1565990</guid>
      <dc:creator>tony_raimo2</dc:creator>
      <dc:date>2011-01-31T02:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP POST and GET using authentication cookie</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-and-get-using-authentication-cookie/m-p/7577171#M1565991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tony,&lt;/P&gt;&lt;P&gt;I have a scenario which is exactly similar to the above post from your end. Request your help for the same.&lt;/P&gt;&lt;P&gt;I too have 2 urls; one for authenticating and another for posting the data. I have been able to successfully authenticate and in receiving 4 cookies in response.&lt;/P&gt;&lt;P&gt;However, being unfamiliar with the steps required for HTTP post and how the cookies are to be passed for the next url, I am not able to post the data to the 2nd URL. Could you please advise on the same.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Charles&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 11:55:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/http-post-and-get-using-authentication-cookie/m-p/7577171#M1565991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-27T11:55:43Z</dc:date>
    </item>
  </channel>
</rss>

