cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to use initial HTTP request (not from HTTP client)

dschiener
Participant
0 Kudos
318

Hi there,

I want to send a newly created HTTP request based on if_http_request or cl_http_request without using the request which is stored in the HTTP client.

I guess the default way to send a HTTP request looks kind of like this:

 

DATA(client) = cl_http_client=>create( ).
" Prepare request
client->request->set_method( ... ).
client->request->set_header_field( ... ).
...

client->send( ... ).

 

By debugging, this way is working, not least because the request object stored in the client contains a member attribute named m_c_msg that is initialized.

I would like to decouple the creation and initialization of the HTTP request by underlying the HTTP client:

 

DATA(client) = cl_http_client=>create( ).

" Prepare request
DATA(request) = NEW cl_http_request( ).
request->set_method( ... ).
request->set_header_field( ... ).
...

client->request = request.
client->send( ... ).

 

In my way the request seems not to be initialized correctly and therefore the sending fails.

Can anyone tell me if it is possible to implement my prefered solution and give me some hints?

BR

Accepted Solutions (0)

Answers (0)