Quantcast
Channel: SCN: Message List - ABAP Connectivity
Viewing all articles
Browse latest Browse all 3125

Re: using FM HTTP_POST

$
0
0

I resolve this issue.

 

 

DATALT_REQUEST_HEADER  TYPE TABLE OF SBCHEADER WITH HEADER LINE,

        LT_REQUEST_BODY    TYPE TABLE OF SBCBODY WITH HEADER LINE,

        LT_RESPONSE_HEADER TYPE TABLE OF SBCHEADER WITH HEADER LINE,

        LT_RESPONSE_BODY   TYPE TABLE OF SBCBODY WITH HEADER LINE.

 

APPEND 'Content-Type: text/xml; charset=UTF-8' TO LT_REQUEST_HEADER.


 

APPEND '<?xml version="1.0" encoding="euc-kr"?>' TO LT_REQUEST_BODY.

APPEND '<root>                                                             ' TO LT_REQUEST_BODY.

APPEND '<params>                                                           ' TO LT_REQUEST_BODY.

* (...blablabla...xml data string...)


* just call

 

CALL FUNCTION 'HTTP_POST'

   EXPORTING

     ABSOLUTE_URI                = URI   " url...

     REQUEST_ENTITY_BODY_LENGTH  = LV_LEN   " blank variable.

     RFC_DESTINATION             = 'SAPHTTP'

*   PROXY                       =

*   PROXY_USER                  =

*   PROXY_PASSWORD              =

*   USER                        =

*   PASSWORD                    =

     BLANKSTOCRLF                = 'X'

   IMPORTING

     STATUS_CODE                 = STATUS_CODE

     STATUS_TEXT                 = STATUS_TEXT

     RESPONSE_ENTITY_BODY_LENGTH = LV_LEN

   TABLES

     REQUEST_ENTITY_BODY         = LT_REQUEST_BODY

     RESPONSE_ENTITY_BODY        = LT_RESPONSE_BODY

     RESPONSE_HEADERS            = LT_RESPONSE_HEADER

     REQUEST_HEADERS             = LT_REQUEST_HEADER.

 

WRITE / 'THE HEADER DATA '.

LOOP AT LT_RESPONSE_HEADER.

   WRITE:/ LT_RESPONSE_HEADER.

ENDLOOP.

 

WRITE:/ 'THE BODY DATA : ' .

 

LOOP AT LT_RESPONSE_BODY.

   WRITE:/ LT_RESPONSE_BODY.

ENDLOOP.



 

When test program, use http monitoring tool(HTTP Analyzer...and so on...) and check http packit header.


Viewing all articles
Browse latest Browse all 3125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>