Feargal Hogan
Feargal Hogan

Reputation: 191

Copy as Response body dynamic value in xml

When working with XML responses I dont have the option to Copy as Response body dynamic value? Is this facility only available with JSON?

UPDATE-1: Can't seem to get it working

I can add the Request object but the Key Path (dotted xpath) to the desired data is not giving the expected results. I am using "plan.link"

So the xml is like this

<plan>
  <id>7286</id>
  <piuid>1</piuid>
  <title>Bollard Positions</title>
  <link>http://<my-server-name>/port/1/plan/7286.gif</link>
</plan>

And I want to pick the url from the link element (plan.link)

But Paw is not reading right and changes the request to

GET / HTTP/1.1
Host: echo.paw.cloud
Connection: close
User-Agent: Paw/3.1.3 (Macintosh; OS X/10.11.6) GCDHTTPRequest

I'm doing something wrong but not sure what.

Any suggestions?

Upvotes: 1

Views: 261

Answers (1)

Micha Mazaheri
Micha Mazaheri

Reputation: 3481

That's true, sadly you cannot just right-click and pick Copy as Response Body Dynamic Value for XML responses (only works for JSON and Form URL-Encoded).

Though, you can manually set a dynamic value to point to this field.

  1. Right-click on a field where you want to insert this reference, and choose Response > Response Parsed Body

Response Parsed Body

  1. Enter the Key Path to the node you want to select, and end it with the text key to access the string's value.

enter image description here

  1. Should be a working reference. You can have the preview below.

Upvotes: 0

Related Questions