<?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: Send Binary File to REST Service (using IF_HTTP_CLIENT) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660930#M2027532</link>
    <description>&lt;P&gt;Why not pasting directly in the forum via copy/paste of images?&lt;/P&gt;&lt;P&gt;e.g. here I just &lt;STRONG&gt;paste (ctrl+V)&lt;/STRONG&gt; your first screenshot (I don't need to upload the file):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sandra_Rossi_0-1712336158318.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/92196i08B2BDFABEE0DD79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sandra_Rossi_0-1712336158318.png" alt="Sandra_Rossi_0-1712336158318.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, if it's code, paste the text, not the image, and I don't see why you indicate RAP, your code is just classic ABAP Development.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Apr 2024 16:58:02 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2024-04-05T16:58:02Z</dc:date>
    <item>
      <title>[SOLVED] Send Binary File to REST Service (using IF_HTTP_CLIENT)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660807#M2027531</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;I need to send a binary file (PDF) to a REST service.&lt;/P&gt;&lt;P&gt;First of all, before develop something in ABAP, I tried the service using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Postman&lt;/STRONG&gt;.&lt;BR /&gt;I have noticed that I can send the files in two ways:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;As a form-data:&lt;BR /&gt;&lt;A class="" href="https://i.postimg.cc/Y9K4v8Lc/1st-way.png" target="_blank" rel="noopener nofollow ugc"&gt;https://i.postimg.cc/Y9K4v8Lc/1st-way.png&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;As a binary:&lt;BR /&gt;&lt;A class="" href="https://i.postimg.cc/85R7MWL7/2nd-way.png" target="_blank" rel="noopener nofollow ugc"&gt;https://i.postimg.cc/85R7MWL7/2nd-way.png&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I have replicated the first way (as a form-data) with the following code:&lt;BR /&gt;&lt;A class="" href="https://i.postimg.cc/FR5qp915/Abap-Code1.png" target="_blank" rel="noopener nofollow ugc"&gt;https://i.postimg.cc/FR5qp915/Abap-Code1.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But I could not replicate in ABAP the second way (as a binary) and the REST service work different if I send the file in those ways (as a binary, the service works fine).&lt;/P&gt;&lt;P&gt;Have someone faced this issue?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 17:44:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660807#M2027531</guid>
      <dc:creator>PabloSerra</dc:creator>
      <dc:date>2024-04-05T17:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Send Binary File to REST Service (using IF_HTTP_CLIENT)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660930#M2027532</link>
      <description>&lt;P&gt;Why not pasting directly in the forum via copy/paste of images?&lt;/P&gt;&lt;P&gt;e.g. here I just &lt;STRONG&gt;paste (ctrl+V)&lt;/STRONG&gt; your first screenshot (I don't need to upload the file):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sandra_Rossi_0-1712336158318.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/92196i08B2BDFABEE0DD79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sandra_Rossi_0-1712336158318.png" alt="Sandra_Rossi_0-1712336158318.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, if it's code, paste the text, not the image, and I don't see why you indicate RAP, your code is just classic ABAP Development.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 16:58:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660930#M2027532</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-04-05T16:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Send Binary File to REST Service (using IF_HTTP_CLIENT)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660939#M2027533</link>
      <description>&lt;P&gt;You indicate very partial information from Postman. You should indicate the full HTTP request as text, not the UI options from Postman. I doubt that the first ABAP code corresponds to the first HTTP request.&lt;/P&gt;&lt;P&gt;Concerning the second HTTP request, I guess it should be simple as that:&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;lo_http_client-&amp;gt;set_content_type( 'application/pdf' ).
lo_http_client-&amp;gt;set_data( iv_pdf_file ).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: no need of multipart.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 17:06:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660939#M2027533</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-04-05T17:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Send Binary File to REST Service (using IF_HTTP_CLIENT)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660943#M2027534</link>
      <description>&lt;P&gt;Thanks for the solution.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 17:09:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660943#M2027534</guid>
      <dc:creator>PabloSerra</dc:creator>
      <dc:date>2024-04-05T17:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Send Binary File to REST Service (using IF_HTTP_CLIENT)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660948#M2027535</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;Unlucky me, that doesn't work.&lt;BR /&gt;The service gives me HTTP 415 (Unsupported Media Type)&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 17:12:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660948#M2027535</guid>
      <dc:creator>PabloSerra</dc:creator>
      <dc:date>2024-04-05T17:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Send Binary File to REST Service (using IF_HTTP_CLIENT)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660960#M2027536</link>
      <description>&lt;P&gt;Thanks again for your reply.&lt;BR /&gt;It finally work but I needed to use&amp;nbsp;'application/octet-stream' instead of&amp;nbsp;'application/pdf'&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 17:43:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660960#M2027536</guid>
      <dc:creator>PabloSerra</dc:creator>
      <dc:date>2024-04-05T17:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Send Binary File to REST Service (using IF_HTTP_CLIENT)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660990#M2027537</link>
      <description>&lt;P&gt;It's a limitation of your server (at the URL you call) which doesn't accept 'application/pdf'.&lt;/P&gt;&lt;P&gt;As I said, impossible to know at my side because you didn't share the full text of the HTTP request which "works" via Postman. Just look at the value of the header field "content-type" and do the same in ABAP. Simple as that.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 18:22:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/solved-send-binary-file-to-rest-service-using-if-http-client/m-p/13660990#M2027537</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-04-05T18:22:25Z</dc:date>
    </item>
  </channel>
</rss>

