Repository navigation
feat: use values from earlier responses, and keep cookies - #14
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sequence files can now use a value from an earlier response, so a flow can log in and then use the token it got. There's also an opt-in cookie jar for APIs that keep the session in a cookie.
Values from earlier responses
{{name.response.body.<path>}}reads JSON from the response of an earlier request namedname.body.a.b[0]reads nested keys and lists,body.$.tokenworks as well asbody.token, andbody.*is the whole body.{{name.response.headers.<Name>}}reads a header. Text goes in as it is; numbers, objects and lists go in as JSON.-nreads its own responses, and after a redirect the value comes from the last hop.-c, while requests that don't depend on anything keep running.ERRwith the variable's name and it counts as failed. Values are never printed, in errors or anywhere else; a value placed in a query string shows in the URL, as the README already warns.# @name, a reused# @name,.request.in place of.response., and a path that can't be read are all errors with the file and line.body_bytesstill counts the bytes as sent. Only JSON can be read from; XML is not.collect.RequestgainsBuild,AfterandKeep, so the collector stays independent of the file format.-Hand-ualso apply to requests that are built at send time.--cookiesgolang.org/x/net/publicsuffix, so a site underfoo.co.kecan't set cookies forbar.co.ke. This addsgolang.org/x/netand raisesx/term,x/sysandx/textby minor versions.request_headersis now copied after the request is sent, so it shows theCookiethe jar added, with values hidden as usual.-cabove 1, a request can still go out before the one that sets its cookie; the docs say so.The README,
--helpand the examples are updated to match.TestConnectionsAreNumberedfails about 4 times in 30 on master as well. If it fails here, it's that existing flaky test, not this change.