<?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: Differences between HTTP_POST and CL_HTTP_CLIENT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/differences-between-http-post-and-cl-http-client/m-p/1831181#M354199</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when using cl_http_client&lt;/P&gt;&lt;P&gt;call method cl_http_client=&amp;gt;create&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    host          = 'www.webservicex.net'&lt;/P&gt;&lt;P&gt;    service       = '80'&lt;/P&gt;&lt;P&gt;    scheme        = '1'&lt;/P&gt;&lt;P&gt;    proxy_host    =  wf_proxy&lt;/P&gt;&lt;P&gt;    proxy_service =  wf_port&lt;/P&gt;&lt;P&gt;  importing&lt;/P&gt;&lt;P&gt;    client        = http_client.&lt;/P&gt;&lt;P&gt;the scheme has to be 2 to tell it that is https&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for setting content type and length the code would be something like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method http_client-&amp;gt;request-&amp;gt;set_header_field&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    name  = 'Content-Type'&lt;/P&gt;&lt;P&gt;    value = 'text/xml; charset=utf-8'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method http_client-&amp;gt;request-&amp;gt;set_header_field&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    name  = 'Content-Length'&lt;/P&gt;&lt;P&gt;    value = txlen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jan 2007 05:22:59 GMT</pubDate>
    <dc:creator>athavanraja</dc:creator>
    <dc:date>2007-01-16T05:22:59Z</dc:date>
    <item>
      <title>Differences between HTTP_POST and CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differences-between-http-post-and-cl-http-client/m-p/1831180#M354198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use function module HTTP_POST from ABAP to send a request to an external server   via HTTPS URL.  This works fine I get a response status back of 200 and the  external server processed the request and I get a correct response in the body of the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try and replicate this using the newer method  cl_http_client . I get a response status back of 200 but the external server can't process the request and doesn't return the expected body response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The call to HTTP_POST  which works is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only header request I have to create is Content-type: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the others are created automatically by the function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'HTTP_POST'&lt;/P&gt;&lt;P&gt;     ABSOLUTE_URI                = url&lt;/P&gt;&lt;P&gt;      REQUEST_ENTITY_BODY_LENGTH  = l_length&lt;/P&gt;&lt;P&gt;      BLANKSTOCRLF                = 'X'&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      STATUS_CODE                 = l_status_code&lt;/P&gt;&lt;P&gt;      STATUS_TEXT                 = l_status_text&lt;/P&gt;&lt;P&gt;      RESPONSE_ENTITY_BODY_LENGTH = l_length_response&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      REQUEST_ENTITY_BODY         = GT_REQUEST_ENTITY_BODY&lt;/P&gt;&lt;P&gt;      RESPONSE_ENTITY_BODY        = GT_RESPONSE_ENTITY_BODY&lt;/P&gt;&lt;P&gt;      RESPONSE_HEADERS            = GT_RESPONSE_HEADERS&lt;/P&gt;&lt;P&gt;      REQUEST_HEADERS             = GT_REQUEST_HEADERS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try and replicate this call using cl_http_client &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I disable the compress.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_http_client-&amp;gt;propertytype_accept_compress = l_http_client-&amp;gt;co_disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;How do I replicate the BLANKSTOCRLF                = 'X' in the HTTP_POST function module?&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The headers that I have to create are now Content-type and Content-length.&lt;/P&gt;&lt;P&gt;when SAP creates the HTTP request it converts these to all lower case e.g. content-type and content-length. Is there anyway I can stop this from happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 01:08:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differences-between-http-post-and-cl-http-client/m-p/1831180#M354198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T01:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between HTTP_POST and CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differences-between-http-post-and-cl-http-client/m-p/1831181#M354199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when using cl_http_client&lt;/P&gt;&lt;P&gt;call method cl_http_client=&amp;gt;create&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    host          = 'www.webservicex.net'&lt;/P&gt;&lt;P&gt;    service       = '80'&lt;/P&gt;&lt;P&gt;    scheme        = '1'&lt;/P&gt;&lt;P&gt;    proxy_host    =  wf_proxy&lt;/P&gt;&lt;P&gt;    proxy_service =  wf_port&lt;/P&gt;&lt;P&gt;  importing&lt;/P&gt;&lt;P&gt;    client        = http_client.&lt;/P&gt;&lt;P&gt;the scheme has to be 2 to tell it that is https&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for setting content type and length the code would be something like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method http_client-&amp;gt;request-&amp;gt;set_header_field&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    name  = 'Content-Type'&lt;/P&gt;&lt;P&gt;    value = 'text/xml; charset=utf-8'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method http_client-&amp;gt;request-&amp;gt;set_header_field&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    name  = 'Content-Length'&lt;/P&gt;&lt;P&gt;    value = txlen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 05:22:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differences-between-http-post-and-cl-http-client/m-p/1831181#M354199</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2007-01-16T05:22:59Z</dc:date>
    </item>
  </channel>
</rss>

