Mike S.
Mike S.

Reputation: 2808

Paw - pass response to subsequent call

The documentation for Response Parsed Body Dynamic Value doesn't make much sense to me. I r-clicked on the JSON response element as described, in this case, userid

{"authorization":"T98J_J8QcH5lC83TOKZxaWB","userid":"T98J_J8QcH5lC83TOKZxaWB","lastLogin":"2014-12-15 15:17"}

but did not receive the menu option to Copy as Dynamic Value as stated. I got the standard text editor context menu. So, either I'm misreading the doc, or it's incorrect. Here's what I want to do: Take the dynamic value for the userid and pass it as part of the URL (not a parameter) to subsequent calls. Is this possible with Paw?

Upvotes: 3

Views: 503

Answers (1)

Micha Mazaheri
Micha Mazaheri

Reputation: 3481

Here's how you can do it manually.

  1. Right click on the field where you want to reuse the value. In the contextual menu, pick Response > Response Parsed Body Paw Response Parsed Body Dynamic Value (1)

  2. Pick the request you want to extract the response from. Enter the JSON key path. Make it explicitly JSON format (Automatic uses the Content-Type, which may not match in some cases). Paw Response Parsed Body Dynamic Value (2)

The Copy as Dynamic Value may not work if your response is not interpreted as JSON, maybe the server is not setting a Content-Type: application/json header?

Upvotes: 2

Related Questions