<?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: ABAP CL_HTTP_CLIENT REST JSON issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502983#M1932959</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the problem might be what is being sent to the CL_HTTP_UTILITY=&amp;gt;SET_REQUEST_URI. The SM59 destination is configured such that when you create your HTTP client, you're already working with an URL of secure.smartwaregroup.com/Bigfoot/OURCOMPANY. So when you set the URI with /Bigfoot/OURCOMPANY/api/methodname, you are double dipping and the web service is attempting to reach secure.smartwaregroup.com/Bigfoot/OURCOMPANY/Bigfoot/OURCOMPANY/api/methodname. I think if you just send over the '/api/methodname' it should work. If not, I can provide another example of how I got this to work on my end by using CREATE_BY_DESTINATION/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Feb 2016 23:58:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-02-10T23:58:11Z</dc:date>
    <item>
      <title>ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502980#M1932956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;We have a need to connect to an external HTTPS REST service from ABAP that uses JSON.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 10pt;"&gt;We are using straight ABAP via SAPGui, not Eclipse, and we are not on 7.4 yet so I can't use the new standard SAP JSON class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 10pt;"&gt;I downloaded and installed the ZJSON stuff, but I'm having trouble finding clear examples describing how it should be used.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;So far, I am calling the CL_HTTP_CLIENT class CREATE_BY_DESTINATION method to open a connection to the external service using Basic Authentication. They have given us a base URL with various method subpaths depending upon the specific function we need to call.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;My trouble spot has been trying to call their API methods where I need to pass parameters but I'm having trouble with the HTTP / REST / JSON syntax using the ABAP CL_HTTP_CLIENT class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am calling CL_HTTP_CLIENT-&amp;gt;REQUEST-&amp;gt;SET_HEADER_FIELD to set the header values: &lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;'~server_protocol' = 'HTTP/1.1'&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;'Accept' = 'application/json'&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;'Content-Type' = 'application/json; charset=utf-8'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am calling CL_HTTP_CLIENT-&amp;gt;REQUEST-&amp;gt;SET_METHOD to set the request method to "POST"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also calling CL_HTTP_UTILITY=&amp;gt;SET_REQUEST_URI to set the full method path (after the base URL), including the specific method we need to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried setting the required method parameters as form fields, but I think they need it to be in JSON format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a test, &lt;SPAN style="font-size: 10pt;"&gt;I hardcoded what they are expecting and called CL_HTTP_CLIENT-&amp;gt;REQUEST-&amp;gt;SET_CDATA but their server returns a very length HTML page instead of the expected return parameters wrapping in JSON syntax.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I on the right track?? Does the CL_HTTP_CLIENT-&amp;gt;REQUEST-&amp;gt;SET_CDATA (or SET_DATA) method place the specified content into the HTTP REST "payload" or should I be doing something else?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for any assistance you can provide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 20:56:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502980#M1932956</guid>
      <dc:creator>bryan_sippel3</dc:creator>
      <dc:date>2016-02-10T20:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502981#M1932957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my experience, if you receive a lengthy HTML string as a response when attempting to call a REST service that string usually represents some sort of HTML error page. It might be helpful to download that complete string and examine it in a notepad-like tool (or even save it to a .htm file and open it with your browser) to see if that offers more clues as to what went wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that doesn't prove to help diagnose the issue, I can offer a basic template for using the CL_HTTP_CLIENT class that is inspired by some code I wrote to link up my SAP instance with a third-party tool. There are some differences compared to your approach but hopefully this'll get help get you to finding the response you are looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Using the this CREATE_BY_URL can simplify certain aspects of using this class&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA&lt;/SPAN&gt; lo_http_client &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;REF&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;TO&lt;/SPAN&gt; if_http_client&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; cl_http_client=&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;create_by_url&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;EXPORTING&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #4da616;"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://rest.test.com/api/docs/doc_id"&gt;https://rest.test.com/api/docs/doc_id&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;IMPORTING&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;client&lt;/SPAN&gt; &lt;SPAN style="color: #800080;"&gt;= &lt;/SPAN&gt;lo_http_client&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;EXCEPTIONS&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; argument_not_found&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; plugin_not_active &lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal_error&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;OTHERS&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;4&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;IF&lt;/SPAN&gt; sy-subrc &lt;SPAN style="color: #800097;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN style="color: #3399ff;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Remember to authenticate&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;authenticate&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; username&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #4da616;"&gt;'my-username'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; password&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #4da616;"&gt;'my-password'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Hardcode your payload here for testing purposes.&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA&lt;/SPAN&gt; lv_payload &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; string&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lv_payload&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #4da616;"&gt;'{"add":{"name":"my-payload"}}'&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Convert that payload to xstring.&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA&lt;/SPAN&gt; lv_payload_x &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;xstring&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;CALL&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;FUNCTION&lt;/SPAN&gt; &lt;SPAN style="color: #4da616;"&gt;'SCMS_STRING_TO_XSTRING'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;EXPORTING&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;text&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;uv_payload&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;IMPORTING&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;buffer&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;lv_payload_x&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* My logic originally used PUT, but you should be able to change to POST&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;request-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;set_method&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt; &lt;SPAN style="color: #4da616;"&gt;'PUT'&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;request-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;set_content_type&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt; &lt;SPAN style="color: #4da616;"&gt;'application/json'&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;request-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;set_data&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt; lv_payload_x &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Sending the request&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;send&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;EXCEPTIONS&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http_communication_failure&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http_invalid_state&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;2&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Receiving the response&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;receive&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;EXCEPTIONS&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http_communication_failure&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http_invalid_state&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http_processing_failed&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;3&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Check the response. Hopefully you get back a JSON response.&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA&lt;/SPAN&gt; lv_response &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; string&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lv_response&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;response-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;get_cdata&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 22:26:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502981#M1932957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-02-10T22:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502982#M1932958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It appears our external REST service is not happy when I use cl_http_client&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;create_by_destination from our SM59 destination. When I changed it to use cl_http_client&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;create_by_url, it appears to be working properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas? I would really prefer to configure and use the SM59 destinations if I could rather than hardcoding the URLs in the code (or storing them somewhere and retrieving them but I guess I could use FILE).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our SM59 destination looks like this:&lt;/P&gt;&lt;P&gt;Target Host&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; secure.smartwaregroup.com&lt;/P&gt;&lt;P&gt;Path Prefix&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /Bigfoot/&lt;SPAN style="font-size: 13.3333px;"&gt;OURCOMPANY&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Service No.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 443&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Likewise, when I call &lt;SPAN style="font-size: 13.3333px;"&gt;cl_http_client&lt;/SPAN&gt;&lt;SPAN class="L0S70" style="font-size: 13.3333px;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;create_by_url, I pass the URL parameter as "https&lt;SPAN class="L0S55"&gt;:&lt;/SPAN&gt;//secure&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;smartwaregroup&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;com/Bigfoot/OURCOMPANY/".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either way, I then use cl_http_utility&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;set_request_uri to set the request method path to "&lt;SPAN style="font-size: 13.3333px;"&gt;/Bigfoot/&lt;SPAN style="font-size: 13.3333px;"&gt;OURCOMPANY/&lt;/SPAN&gt;api/methodname".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you ever seen differences between create_by_destination and create_by_url or differences in the way external company REST services behave?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 23:01:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502982#M1932958</guid>
      <dc:creator>bryan_sippel3</dc:creator>
      <dc:date>2016-02-10T23:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502983#M1932959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the problem might be what is being sent to the CL_HTTP_UTILITY=&amp;gt;SET_REQUEST_URI. The SM59 destination is configured such that when you create your HTTP client, you're already working with an URL of secure.smartwaregroup.com/Bigfoot/OURCOMPANY. So when you set the URI with /Bigfoot/OURCOMPANY/api/methodname, you are double dipping and the web service is attempting to reach secure.smartwaregroup.com/Bigfoot/OURCOMPANY/Bigfoot/OURCOMPANY/api/methodname. I think if you just send over the '/api/methodname' it should work. If not, I can provide another example of how I got this to work on my end by using CREATE_BY_DESTINATION/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 23:58:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502983#M1932959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-02-10T23:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502984#M1932960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had tried that at first, and I guess because of other issues, I thought it needed to be the full path. Now that the other issues appear to be cleared up, I changed it back and it is working now. Thank you so much for all your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 00:11:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502984#M1932960</guid>
      <dc:creator>bryan_sippel3</dc:creator>
      <dc:date>2016-02-11T00:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502985#M1932961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I'm getting a response back from the /api/login method, and now I'm trying to call the /api/users method and I'm getting a status 500 Internal server error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I have to close the connection and re-create the connection between each call or can I just call the cl_http_utility&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;set_request_uri to change the api method path?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 00:24:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502985#M1932961</guid>
      <dc:creator>bryan_sippel3</dc:creator>
      <dc:date>2016-02-11T00:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502986#M1932962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you can use the method refresh_request&lt;SPAN class="L0S55"&gt;( &lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;) on the CL_HTTP_CLIENT instance to reset your request object. I found that calling this method allowed me to send multiple requests on the same open HTTP client.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S55"&gt;Here's how it works:&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Retrieving response from first request&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; cv_doc_info&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;response-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;get_cdata&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Reset request for this client&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;refresh_request&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Setup the next request&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;request-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;set_method&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt; &lt;SPAN style="color: #4da616;"&gt;'GET'&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; cl_http_utility=&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;set_request_uri&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; request&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;request&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uri&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;lv_new_uri&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;EM style="color: #808080;"&gt;* Submit request next request&lt;/EM&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; lo_http_client-&lt;SPAN style="color: #800097;"&gt;&amp;gt;&lt;/SPAN&gt;send&lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt; &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 01:37:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502986#M1932962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-02-11T01:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502987#M1932963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For each of my method calls, I am calling the refresh_request method right before I set my new API method URL and call SEND -- I was hoping it would work that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Unfortunately, even after I figure out the cause for the server error, t&lt;/SPAN&gt;he REST service I am trying to call requires me to place the session token returned from their login method into the HTML Authentication header under "Basic", but it appears SAP wants to keep the fields used by their authentication method separate, USERNAME and PASSWORD, and I don't see a way to edit the RAW HTML before I call the SEND method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Might you happen to know how to set or edit the raw HTML prior to calling SEND?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I &lt;SPAN style="font-size: 13.3333px;"&gt;instead &lt;/SPAN&gt;try using HTTP_POST or some other HTTP FM that might allow me to specifically control the HTML header content?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 16:49:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502987#M1932963</guid>
      <dc:creator>bryan_sippel3</dc:creator>
      <dc:date>2016-02-11T16:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502988#M1932964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok... problems solved!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am now able to call multiple REST api methods. The REST service we are calling required the login session token to be passed in the HTML Authentication header, so I was able to call the&amp;nbsp; http_client&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;request&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;set_header_field method with name = "Authorization" and I concatenated "Basic" with my session token (separated by space) as the value parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using ZJSON to convert my ABAP --&amp;gt; JSON before each SEND call using their&amp;nbsp; zcl_json_document&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;create_with_data method and from JSON --&amp;gt; ABAP after each RECEIVE / GET_CDATA call using their&amp;nbsp; zcl_json_document&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;create_with_json and get_data methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for all your help!! &lt;SPAN __jive_emoticon_name="grin" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/74/images/emoticons/grin.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 20:48:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502988#M1932964</guid>
      <dc:creator>bryan_sippel3</dc:creator>
      <dc:date>2016-02-11T20:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502989#M1932965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the update! I couldn't really replicate the scenario you ran into but it's good to know how you solved it in case I ever run into it myself. Glad everything worked out, I certainly learned a lot from this exchange.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 20:53:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502989#M1932965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-02-11T20:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502990#M1932966</link>
      <description>&lt;P&gt;i get CSRF token validation failed with your code &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 00:08:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502990#M1932966</guid>
      <dc:creator>naotoxxx</dc:creator>
      <dc:date>2019-05-24T00:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502991#M1932967</link>
      <description>&lt;P&gt;Hi Brian,&lt;/P&gt;&lt;P&gt;I would appreciate your comments about the next issue. &lt;BR /&gt;I have the next URL that works in Chrome: &lt;A href="https://junjitest.mineduc.cl/api-doc-parv/v1/docente/35605/rut/17878912?apikey=SpfBRV2HHyxAyaWcorai777RubbFGpYg"&gt;https://junjitest.mineduc.cl/api-doc-parv/v1/docente/35605/rut/17878912?apikey=SpfBRV2HHyxAyaWcorai777RubbFGpYg&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have adapted your code as you can see:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cl_http_client=&amp;gt;create_by_url(
 EXPORTING
 url = 'https://junjitest.mineduc.cl/api-doc-parv/v1/docente/35605/rut/17878912?apikey=SpfBRV2HHyxAyaWcorai777RubbFGpYg'
 IMPORTING
 client = lo_http_client
 EXCEPTIONS
 argument_not_found = 1
 plugin_not_active = 2
 internal_error = 3
 OTHERS = 4 ).&lt;BR /&gt;
IF sy-subrc &amp;lt;&amp;gt; 0.
 RETURN.
ENDIF.&lt;BR /&gt;
* I've changed my logic to use GET method:
lo_http_client-&amp;gt;request-&amp;gt;set_method( 'GET' ).
lo_http_client-&amp;gt;request-&amp;gt;set_content_type( 'application/json' ).&lt;BR /&gt;
* Sending the request
lo_http_client-&amp;gt;send(
 EXCEPTIONS
 http_communication_failure = 1
 http_invalid_state = 2 ).&lt;BR /&gt;
* Receiving the response
lo_http_client-&amp;gt;receive(
 EXCEPTIONS
 http_communication_failure = 1
 http_invalid_state = 2
 http_processing_failed = 3 ).&lt;BR /&gt;
* Check the response. Hopefully you get back a JSON response.
DATA lv_response TYPE string.&lt;BR /&gt;
lv_response = lo_http_client-&amp;gt;response-&amp;gt;get_cdata( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the response has been:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&amp;gt;#&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;#&amp;lt;title&amp;gt;404 Not Found&amp;lt;/title&amp;gt;#&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;#&amp;lt;h1&amp;gt;Not Found&amp;lt;/h1&amp;gt;#&amp;lt;p&amp;gt;The requested URL /api-doc-parv/v1/docente/35605/rut/17878912 was not found on this server.&amp;lt;/p&amp;gt;#&amp;lt;hr&amp;gt;#&amp;lt;address&amp;gt;Apache/2.2.15&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'll appreciate any comments about it.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;José Jaimes&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 17:24:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502991#M1932967</guid>
      <dc:creator>former_member619401</dc:creator>
      <dc:date>2019-07-24T17:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP CL_HTTP_CLIENT REST JSON issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502992#M1932968</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a similar requirement and  I am facing the same issue. Were you able to resolve the issue, if so please can you give me the code.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 20:49:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-cl-http-client-rest-json-issue/m-p/11502992#M1932968</guid>
      <dc:creator>former_member786217</dc:creator>
      <dc:date>2022-01-20T20:49:41Z</dc:date>
    </item>
  </channel>
</rss>

