<?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: Passing data using application/x-www-form-urlencoded using IF_HTTP_CLIENT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-data-using-application-x-www-form-urlencoded-using-if-http-client/m-p/12815539#M2025913</link>
    <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; &amp;amp; &lt;SPAN class="mention-scrubbed"&gt;javier_alonso&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your replies. I found an issue with URL which i am pssing to create http_client. After correcting it is working fine.&lt;/P&gt;&lt;P&gt;Thanks once again.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Archana&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2024 10:01:48 GMT</pubDate>
    <dc:creator>pillaiarchana</dc:creator>
    <dc:date>2024-01-04T10:01:48Z</dc:date>
    <item>
      <title>Passing data using application/x-www-form-urlencoded using IF_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-data-using-application-x-www-form-urlencoded-using-if-http-client/m-p/12815536#M2025910</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
  &lt;P&gt;I am new to this. I have one requirement to pass data in urlencoded format. I am using one url to retrieve token. In this URL, I am passing data using IF_HTTP_CLIENT with content type application/x-www-form-urlencoded in ABAP program. My program is working fine in postman. In postman, I am passing content type in Header and certain fields in Body part of postman ( i.e. grant_type, client_id, client_secret ) and it is working ok in postman, But when I am passing it in ABAP. it is giving me 404 error. I &lt;/P&gt;
  &lt;P&gt;I am passing below data: &lt;/P&gt;
  &lt;P&gt;lv_body = 'grant_type=client_credentials&amp;amp;client_id=ABCD&amp;amp;client_secret=ABCDEFGHIJK≻ope=openid'.&lt;/P&gt;
  &lt;P&gt; LO_HTTP_CLIENT-&amp;gt;PROPERTYTYPE_LOGON_POPUP = LO_HTTP_CLIENT-&amp;gt;CO_DISABLED.&lt;BR /&gt; LO_HTTP_CLIENT-&amp;gt;REQUEST-&amp;gt;SET_METHOD( 'POST' ).&lt;BR /&gt; LO_HTTP_CLIENT-&amp;gt;REQUEST-&amp;gt;SET_HEADER_FIELD(&lt;BR /&gt; NAME = 'Content-Type'&lt;BR /&gt; VALUE = 'application/x-www-form-urlencoded' ).&lt;/P&gt;
  &lt;P&gt;CALL FUNCTION 'SCMS_STRING_TO_XSTRING'&lt;/P&gt;
  &lt;P&gt; EXPORTING&lt;BR /&gt; TEXT = LV_BODY&lt;BR /&gt; IMPORTING&lt;BR /&gt; BUFFER = LV_BODYX.&lt;BR /&gt;&lt;BR /&gt; CALL METHOD LO_HTTP_CLIENT-&amp;gt;REQUEST-&amp;gt;SET_DATA( LV_BODYX ).&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Archana&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 06:07:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-data-using-application-x-www-form-urlencoded-using-if-http-client/m-p/12815536#M2025910</guid>
      <dc:creator>archanapillai</dc:creator>
      <dc:date>2023-12-29T06:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Passing data using application/x-www-form-urlencoded using IF_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-data-using-application-x-www-form-urlencoded-using-if-http-client/m-p/12815537#M2025911</link>
      <description>&lt;P&gt;404 means page not found, so it's probably an issue with the URL (what you didn't post).&lt;/P&gt;&lt;P&gt;Do an ICF Client trace (SICF &amp;gt; menu) to know the exact HTTP request sent, compare with Postman, and tell us what is different between the 2 HTTP requests.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 09:08:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-data-using-application-x-www-form-urlencoded-using-if-http-client/m-p/12815537#M2025911</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-12-29T09:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Passing data using application/x-www-form-urlencoded using IF_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-data-using-application-x-www-form-urlencoded-using-if-http-client/m-p/12815538#M2025912</link>
      <description>&lt;P&gt;Try passing the parameters as form fields instead of body data.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cl_http_client=&amp;gt;create_by_url( EXPORTING url = ws_url IMPORTING client = DATA(http_client) ).

http_client-&amp;gt;request-&amp;gt;set_method( if_http_request=&amp;gt;co_request_method_post ).
http_client-&amp;gt;request-&amp;gt;set_header_field( name = 'Content-Type' value = 'application/x-www-form-urlencoded' ).
http_client-&amp;gt;request-&amp;gt;set_form_field( name = 'client_id' value = 'ABCD' ).
http_client-&amp;gt;request-&amp;gt;send( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I currenlty have an url-encoded WebService which I pass the parameters this way and works fine.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 09:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-data-using-application-x-www-form-urlencoded-using-if-http-client/m-p/12815538#M2025912</guid>
      <dc:creator>javier_alonso63</dc:creator>
      <dc:date>2024-01-04T09:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Passing data using application/x-www-form-urlencoded using IF_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-data-using-application-x-www-form-urlencoded-using-if-http-client/m-p/12815539#M2025913</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; &amp;amp; &lt;SPAN class="mention-scrubbed"&gt;javier_alonso&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your replies. I found an issue with URL which i am pssing to create http_client. After correcting it is working fine.&lt;/P&gt;&lt;P&gt;Thanks once again.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Archana&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 10:01:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-data-using-application-x-www-form-urlencoded-using-if-http-client/m-p/12815539#M2025913</guid>
      <dc:creator>pillaiarchana</dc:creator>
      <dc:date>2024-01-04T10:01:48Z</dc:date>
    </item>
  </channel>
</rss>

