Application Development 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: 

How to execute curl command in abap ?

kyoungmi_oh
Explorer
0 Kudos

Dear.

As we need to implement 3rd party http API, their specification is fit with curl command.

curl -X POST --data "action=send" --data "data=<PAYLOAD>" http://www.mgage.solutions/servxml/XML_parse_API.php


Is there any way to call curl command in abap ?

and any other things to install in application server like HTTP_APP ?

Would you guide me how to call curl command from A to Z in detail ?

Best Regards,

SJ.

9 REPLIES 9

Domi
Contributor

Hi

The WAS has an integrated HTTP server and client - you can use this to do the HTTP POST

Creating the HTTP Client

regards

Domi

0 Kudos

Dear. Domi.

Yes, http connection was first thing we try. But there's limitation to call solution API.

API does not support POST method putting value in header side.

That's why 3rd party API suggests to use curl and we struggles to find how to call it on ABAP.

Regards,

SJ.

0 Kudos

Hi

then put it in the body - eg as form data

regards

Domi

0 Kudos

Hi.

both body or header, it's not working.

Their API are not ready to get data in header and body.

It's just query string method, but it occurs 414 error when having long parameter value.

So need to implement it with curl.

Regards,

SJ.

0 Kudos

Hi

If you get an 414 from the server, how shoult this work with curl? If the "payload" is too large it won't work in curl either!?

regard

Domi

Sandra_Rossi
Active Contributor
0 Kudos

HTTP 414 is "Request URI too long", so it seems that you passed the payload both through the body and through the URI. Why??? Pass the payload either in the URI or in the body, not in both!

That's not really an ABAP question by the way.

Sandra_Rossi
Active Contributor
0 Kudos

Do you know that you can execute HTTP requests from ABAP? The answers are in the web.

kyoungmi_oh
Explorer
0 Kudos

HI, Rossi.

Would you post URL describing on how to execute HTTP request from ABAP ?

Regards,

SJ

Sandra_Rossi
Active Contributor
0 Kudos

I meant "search yourself, the answers are in the web"