‎2006 Aug 30 4:29 PM
Hello,
I have to generate a program to post a file ".TXT" to a web server using a HTTP POST with multipart form and a couple of variables (user, password).
I was investigating and I found that I can do it using SAPHTTP but I dont know how to work with the FM HTTP_POST.
Does anyone have a sample code?
Thanks
Ariel
‎2006 Aug 30 4:33 PM
sample usage:
CALL FUNCTION 'HTTP_POST'
EXPORTING
ABSOLUTE_URI = IM_OFX_CONTROL_DATA-ADDRESS
REQUEST_ENTITY_BODY_LENGTH = RESPONSE_ENTITY_BODY_LENGTH
RFC_DESTINATION = IM_OFX_CONTROL_DATA-HTTP_RFCDEST
USER = IM_OFX_CONTROL_DATA-HTTP_USER
PASSWORD = IM_OFX_CONTROL_DATA-HTTP_PASSWORD
BLANKSTOCRLF = 'X'
IMPORTING
STATUS_CODE = STATUS
STATUS_TEXT = STATUS_TEXT
RESPONSE_ENTITY_BODY_LENGTH = RLENGTH
TABLES
REQUEST_ENTITY_BODY = LT_REQUEST
RESPONSE_ENTITY_BODY = RESPONSE
RESPONSE_HEADERS = LT_RESPONSE_HEADERS
REQUEST_HEADERS = LT_HTTP_HEADERS
EXCEPTIONS
OTHERS = 1.
Refer the programs:
LFPIFF02
LOFXALSU04
LPRGN_URL_RESPONSEU01
LSBCCU01
LSFTPU09
for some idea.
regards,
ravi
‎2006 Sep 03 8:15 AM
if you are on was6.10 or above use class cl_http_client
demo program for the same.
RSHTTP01
else you can use HTTP_POST / HTTP_GET
you need to pass proper http headers in REQUEST_HEADERS tables parameter.
demo program
RSHTTP20
RSHTTP70
RSHTTP90
Regards
Raja