<?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: Read file from HTTP server. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-http-server/m-p/7056713#M1502771</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following code will POST a parameter to a server and receive data: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lo_client TYPE REF TO if_http_client,                                      
      lv_url TYPE string VALUE 'http://someserver.com/'                                                                                
CALL METHOD cl_http_client=&amp;gt;create_internal                                      
  IMPORTING                                                                      
    client = lo_client.                                                                                
cl_http_utility=&amp;gt;set_request_uri( request  = lo_client-&amp;gt;request                  
                                  uri      = lv_url ).                           
lo_client-&amp;gt;request-&amp;gt;set_header_field( name  = '~request_method'                  
                                      value = 'POST' ).                          
lo_client-&amp;gt;request-&amp;gt;set_form_field( EXPORTING name  = 'myfield'                  
                                              value = 'myvalue' ).               
lo_client-&amp;gt;send( ).                                                                                
* get response                                                                   
      call method li_client-&amp;gt;receive                                             
        exceptions                                                               
          http_communication_failure = 1                                         
          http_invalid_state         = 2                                         
          http_processing_failed     = 3                                         
          others                     = 4.                                        
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you might be better of creating a web service for this kind of communication. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Jul 2010 10:28:38 GMT</pubDate>
    <dc:creator>frank_stdle</dc:creator>
    <dc:date>2010-07-12T10:28:38Z</dc:date>
    <item>
      <title>Read file from HTTP server.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-http-server/m-p/7056712#M1502770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to read a file on http server of a 3rd party application, in R/3 system.&lt;/P&gt;&lt;P&gt;How can this be acheived?&lt;/P&gt;&lt;P&gt;Kindly help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pratibha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jul 2010 08:05:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-http-server/m-p/7056712#M1502770</guid>
      <dc:creator>PratibhaK</dc:creator>
      <dc:date>2010-07-12T08:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read file from HTTP server.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-http-server/m-p/7056713#M1502771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following code will POST a parameter to a server and receive data: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lo_client TYPE REF TO if_http_client,                                      
      lv_url TYPE string VALUE 'http://someserver.com/'                                                                                
CALL METHOD cl_http_client=&amp;gt;create_internal                                      
  IMPORTING                                                                      
    client = lo_client.                                                                                
cl_http_utility=&amp;gt;set_request_uri( request  = lo_client-&amp;gt;request                  
                                  uri      = lv_url ).                           
lo_client-&amp;gt;request-&amp;gt;set_header_field( name  = '~request_method'                  
                                      value = 'POST' ).                          
lo_client-&amp;gt;request-&amp;gt;set_form_field( EXPORTING name  = 'myfield'                  
                                              value = 'myvalue' ).               
lo_client-&amp;gt;send( ).                                                                                
* get response                                                                   
      call method li_client-&amp;gt;receive                                             
        exceptions                                                               
          http_communication_failure = 1                                         
          http_invalid_state         = 2                                         
          http_processing_failed     = 3                                         
          others                     = 4.                                        
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you might be better of creating a web service for this kind of communication. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jul 2010 10:28:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-file-from-http-server/m-p/7056713#M1502771</guid>
      <dc:creator>frank_stdle</dc:creator>
      <dc:date>2010-07-12T10:28:38Z</dc:date>
    </item>
  </channel>
</rss>

