Ask a Question

How do I extract the new resource created via a REST POST for use in a subsequent request?

SOLVED
AndyHughes
Regular Contributor

How do I extract the new resource created via a REST POST for use in a subsequent request?

The API I'm testing is RESTful so I can create a resource such as an account number by sending a POST to AndysAPI/newaccount

The code there generates an account number for me based on the details I've provided, but being RESTful does nothing but send back a success message in the raw response and the newly created URI ie AndysAPI/newaccount/1234.

That great but there's no message body. Therefore I can't update this resource by referencing it in a subsequent test using a GET DATA.

Any ideas how to get round this? I want to be able to extract 1234 from the raw response and use it in a subsequent request to update the account. At the moment I can only put the entire raw response in the next request because I can't specify the part I want.

11 REPLIES 11

thanks a lot.  Cat Very Happy

thanks for the info Smiley Happy

cancel
Showing results for 
Search instead for 
Did you mean: