Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

POST using Rest API , Not able to get body

0 Likes
8,835

Hello Experts

Please guide ,

Scenario: I am making a POST API call in the Postman Tool. I get a response back with a Token in the body . I am trying to now call the same API in ABAP . I am not able to get the body of the response although the message status is successful (200) . Can you pls advise if i am missing anything .

Thanks

Parmesh

Postman Request Details

Response Details

ABAP Code

Hello Experts

Please guide ,

Scenario: I am making a POST API call in the Postman Tool. I get a response back with a Token in the body . I am trying to now call the same API in ABAP . I am not able to get the body of the response although the message status is successful (200) . Can you pls advise if i am missing anything .

Thanks

Parmesh

Postman Request Details

Response Details

ABAP Code

7 REPLIES 7
Read only

Sandra_Rossi
Active Contributor
0 Likes
7,879

What does lv_body look like before calling?

Read only

0 Likes
7,879

Thank you Sandra for replying . The lv_body is correctly formatted as json

Read only

0 Likes
7,731

I have the same problem, did you find the solution?

Thanks.

Read only

thomas_mller13
Participant
0 Likes
7,687

Did you check "get_string_data"?

thomas_mller13_0-1713268416984.png

"response" should be the string and not an object.

Read only

0 Likes
7,640

Yes I tried.

This error message occurred in the trace:

leonardo_buryanteixeira_0-1713384538233.png

Thanks for answering.

Read only

0 Likes
7,639

What did you create in SM59? 

Read only

Koen_VL
Participant
7,591

most probably the request is failing. can you check the value of the http_status?

Looking at the trace error, most probably there is an issue with the SSL connectivity. Maybe the root certificate is not added in STRUST?

What could also help finding out the issue is to put the request in the SAP Gateway Client (transaction /IWFND/GW_CLIENT) and do the get from there. There you have more visibility on status codes and error messages.

hope it helps