cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver REST - Form-Data

Former Member
0 Kudos

I  need to call a REST service that accepts only form-data . In POSTMAN, I am able to to call the service by using the POST operation, entering the service end point , and in the BODY tab, I select "form-data" and pass the values to the key that the service expects . This service does not accept XML or JSON in the Request body .

How do I configure this in the Receiver REST adapter?

Accepted Solutions (1)

Accepted Solutions (1)

maheswarareddykonda
Active Contributor
0 Kudos

Hello,

AFAIK, Rest Adapter is capable to use Media types only application/json and application/xml

anyway, you can try like below

i wonder if that works, please let us know...also you please check with SAP if they corrected in latest Service pack.

Former Member
0 Kudos

Thanks for your suggestion . I resolved it using a Java map by passing the input as a simple string.

maheswarareddykonda
Active Contributor
0 Kudos

Ok..Great..

is that possible to share , how you wrote..that may useful to someone in future

Answers (2)

Answers (2)

nileshkshirsagar
Discoverer
0 Kudos

@maheswarareddykonda : Can you please share solution. I've a requirement to send data over REST using form-data. Able to perform same using POSTMAN as mention above, but with PO, I keep getting BAD request error.

Any help will be appreciated.

Thank you,

Nilesh

ankit_mishra09
Participant
0 Kudos

Hi Nilesh,

Were you able to resolve this? Please share a solution.

former_member815746
Discoverer
0 Kudos

Hi,

Were you guys able to fix the issue?

Former Member
0 Kudos

Simple java map , construct the request as a  String and write it to the OutputStream. Map it to any dummy message type.

Also, in the REST Receiver need to configure Content-Type as application/x-www-form-urlencoded . But simply setting in the Header fields didnt work.

Using your suggestion,  set it using MTB Transform.ContentType parameter. And that worked, thanks.. Seems like a bug in the Receiver REST adapter.

maheswarareddykonda
Active Contributor
0 Kudos

Also, in the REST Receiver need to configure Content-Type as application/x-www-form-urlencoded. But simply setting in the Header fields didnt work.

https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F6465...

check this

Former Member
0 Kudos

Hello Dev Noronha,

I'm working with this scenario. Is that possible to share the output string, because my string format didn't work (String: FieldName=Value....).

Regards.