Skip to Content
0
Former Member
May 27, 2008 at 07:24 PM

Problem with HTTP_POST

32 Views

Hi all,

My client has SAP version 4.6c.

I'm trying to send 2 parameters (not XML, just 2 values) from ABAP to website (http://99.9.99.99:8500) using FM HTTP_POST.

If I executed the following command from web browser, it returns back the values I send:

http://99.9.99.99:8500?par1=test&par2=123

The browser returns:

Received test and 123

But if I execute my ABAP program using HTTP_POST,

CONCATENATE 'par1=' str INTO t_request_body-body.

APPEND t_request_body.

CONCATENATE 'par2=' int INTO t_request_body-body.

APPEND t_request_body.

MOVE: 'text/html' TO w_content.

CALL FUNCTION 'HTTP_HEADERS_CREATE'

EXPORTING

pi_content_type = w_content

TABLES

pt_http_headers = t_request_header.

CALL FUNCTION 'HTTP_POST'

EXPORTING

absolute_uri = uri

request_entity_body_length = 300

blankstocrlf = 'X'

IMPORTING

status_code = status_code

status_text = status_text

response_entity_body_length = len

TABLES

request_entity_body = t_request_body

request_headers = t_request_header

response_entity_body = t_response_body

response_headers = t_response_header.

The return internal table t_response_body contain only the following:

Received and

So it seems the connection is good, but the website coundn't receive my parameters.

Does anybody know why?

Thanks,

Chang