Skip to Content
0
Former Member
Feb 19, 2009 at 10:57 AM

How to pass parameter in HTTP_POST or HTTP Class

43 Views

I want to use HTTP_POST to pass xml info by http_post. I want to pass a simple parameter and receive it in a JSP first for test. I assign the value in the following way:

...

TYPES: BEGIN OF text,

line(256),

END OF text.

DATA xml TYPE TABLE OF text WITH HEADER LINE.

xml-line = 'apple=aaa'.

APPEND xml.

and then ...

CALL FUNCTION 'HTTP_POST'

...

TABLES

REQUEST_ENTITY_BODY = xml

response_entity_body = response

response_headers = response_headers.

******************************************************

then I use a JSP to receive the parameter, but what I get from "apple" is null.

<br>Param APPLE

<%

String apple=request.getParameter("apple");

out.println(apple);

%>

QUESTION:

1 Is this way correct for passing a parameter via a HTTP? It seems I failed to pass a parameter.What is the correct way?

2 If I want to pass a whole xml string, what format should I organize my data stream?Maybe I should use cl_http_client to make it?