Forum Discussion

supriyabora89's avatar
supriyabora89
Occasional Visitor
4 years ago

How to convert Postman POST Request to POST Request in ReadyAPI 3.0.0

I am trying to create a POST request in Ready API 3.0.0 where I want to replicate a Postman request where all the content in mentioned in the body tab as the screenshot below:

 

How can I create the same request in Ready API, so far I was able to add REST Request and mention the URL, but I want to give me parameters in JSON,

1. How do I do that in the correct way, so that I dont get Bad Request error.

2. Also, am I using the correct approach to create the above Postman request in Ready API? Or should I select "multipart/form-data" as the Media Type, if should how should that be done?

 

 

 

  • Hey supriyabora89 

     

    I think I remember the 'form-data' radio button in Postman equates to the 'multipart/form-data' MediaType combo box in ReadyAPI! (which generates a 'Content-Type' header of 'multipart/form-data' type value).

     

    You could double check by checking the headers on your successful Postman request and then you could alter ReadyAPI!'s settings accordingly to match.

     

    If my memory is correct - I tested two endpoints that supported multipart/form-data types - one of them didn't support types of application/json, whereas one endpoint did - so I was able to just change the MediaType to application/json in ReadyAPI! when I did this before - however, it all depends on what your endpoint supports.

     

    By the way - did I read your ReadyAPI! screenshot correctly?  You have a json payload and one of the values in the json payload is actually wellformed XML?  That's weird.

     

    The other option (and this has never really worked for me, but still) - you could try exporting your Postman collection and then use ReadyAPI!s Postman plugin to import the collection - this in theory, should do all the transformation required so you shouldn't have to bother worrying about type options at all.  Just a suggestion - some people have a lot of success with the Postman plugin - I never did whenever I tried it,

     

    ta

     

    rich

  • richie's avatar
    richie
    Community Hero

    Hey supriyabora89 

     

    I think I remember the 'form-data' radio button in Postman equates to the 'multipart/form-data' MediaType combo box in ReadyAPI! (which generates a 'Content-Type' header of 'multipart/form-data' type value).

     

    You could double check by checking the headers on your successful Postman request and then you could alter ReadyAPI!'s settings accordingly to match.

     

    If my memory is correct - I tested two endpoints that supported multipart/form-data types - one of them didn't support types of application/json, whereas one endpoint did - so I was able to just change the MediaType to application/json in ReadyAPI! when I did this before - however, it all depends on what your endpoint supports.

     

    By the way - did I read your ReadyAPI! screenshot correctly?  You have a json payload and one of the values in the json payload is actually wellformed XML?  That's weird.

     

    The other option (and this has never really worked for me, but still) - you could try exporting your Postman collection and then use ReadyAPI!s Postman plugin to import the collection - this in theory, should do all the transformation required so you shouldn't have to bother worrying about type options at all.  Just a suggestion - some people have a lot of success with the Postman plugin - I never did whenever I tried it,

     

    ta

     

    rich