on 03-01-2019 10:01 AM
Hello Friends, I am new to web service topic and read many articles before finally coming here to post my question.
My requirement is to consume a webservice provided by our partner as URL.
I have tested the scenario first in POSTMAN app, by passing some header and Body fields. It worked fine.
Now same thing I am trying to replicate in SAP ABAP, for this I have used cl_http_client=>create_by_url
Header Fields I am populating using http_client->request->set_header_field.
My query is how I can populate or which method I have to use in ABAP to populate the fields similar to what I am setting in BODY of postman app. I am putting screenshot of POSTMAN app, same I am looking to map in ABAP. Header is populated correctly now want to populate BODY.
This may be very basic question, but I am not able to yet figure out the solution.
Thanks,
Brij
Hi Thomas,
I tried this code, but still getting error,
lo_http_client->request->set_form_field( EXPORTING name = 'fileName'
value = 'abc.pdf' ).
Error:
{"error":{"code":500,"message":"An unexpected error occurred. Please contact the service."}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
brijsoni
Hello,
for HTTP "Form fields" you can use:
request->set_form_field "for one field+value
request->set_form_fields "for multiple at once
"Example:
lo_http_client->request->set_form_field( EXPORTING name = ''
value = '' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tomas
Sequence I am calling is,
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.