You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Execute after-response script failed: Error: Error: new Url(): failed to parse hostname in url ${urlStr}
Reproduction Steps
Add a GET request that returns the full URL in a json response body property. For example, a call that returns this:
{
"url": "https://google.com"
}
Add a PUT request that uses the full URL by referencing the Response -> Body Attribute of "url" returned by the request in step 1 as its endpoint to call.
Hello @devguydavid, you are seeing {% ... %} because template tags (such as your case or environment tags) are evaluated after the pre-request script step. Probably you could try insomnia.environment.set('url', url) and access it in the next request at the moment and we will take a look at it, as currently there seems no quick and elegant way to handle this.
Yes, thank you, that is a fine workaround. One of the things I love about Insomnia is not needing to use environment variables for passing data around (looking at you, Postman), but in a pinch it works!
Expected Behavior
Parsing of the response succeeds
Actual Behavior
This error:
Unexpected Request Failure
The request failed due to an unhandled error:
Execute after-response script failed: Error: Error: new Url(): failed to parse hostname in url ${urlStr}
Reproduction Steps
Is there an existing issue for this?
Additional Information
Here is a collection that exhibits the error using mocky.io:
Reproduce Hostname Parsing Error.json
Insomnia Version
10.0.0
What operating system are you using?
macOS
Operating System Version
Mac OS Sequoia 15.0
Installation method
dmg downloaded from the website
Last Known Working Insomnia version
No response
The text was updated successfully, but these errors were encountered: