Skip to Content

Unable to post json data to web service API through POST method

Hi People,

I am struggling for quite some time now with this issue. I need to send details in the form of json and update it in web service API through POST method.

I have tried a couple of codes which I referred from the net, but no success.

Can you please provide some inputs regarding this?

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Oct 30, 2015 at 04:33 AM

    Any One pls?

    Add comment
    10|10000 characters needed characters exceeded

    • Offset value as in are you saying the response returned by get_cdata()? Or can you explain in a little more detail. I am just getting a line as this one .

      success: true,

      Product: “Data should be in JSON format”

      also, I am getting status code as 200 and not 201. Is there any X-CSRF token or something related over here?

  • Nov 02, 2015 at 11:24 AM

    Hi Guys,

    My post method works in POSTMAN. Can you let me know how can I map it with SAP? I am only passing the key data and value of new record under BODY tab after passing the URL and selecting POST method.

    But when i try in SAP like this

       CALL METHOD lo_request->set_form_field

         exporting

           name = 'data'

           value = '[{"custom_code":"1001","stock":"6"}]'.


    It does not work.

    Any idea?


    C1.JPG (55.0 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Nov 03, 2015 at 04:16 AM

    Hi

    any one can please throw some light on this? I am really stuck and its causing me a lot of time.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Dharmin Doshi

      Print out your code, then print out my code.

      Compare the differences...

      If they are looking identical then you may have a token issue to get around. See if the system you're posting too can switch off any token requirements.

      But seeing as your Postman usage works (are you definitely sure...entries in the table??) this may not be the case.

      Regards

      Arden