Ability to chain requests (like Insomnia REST client)
Right now we can save (part of) the response of a request (for example, an access-token, let's call this request Authenticate) to a variable, which can then be used in another request. However, this access-token will expire. You'll find this out when performing the main request. You'll then have to go back to the Authenticate request and re-send it so it updates the access-token variable. This becomes really cumbersome when there are multiple requests depending on each-other.
In Insomnia we can chain requests via Tags and specify a Trigger Behavior:

In addition it would be very nice if the dependent request could also be triggered when the depending request fails (for example 401 unauthorized). This could happen for example when the back-end application resets without persistent token-state.
And super nice would be if we would see this dependency-chain in action in some window/widget.
I am sorry if this is already possible. I did not find such feature.
Hi @saefren currently this is not in roadmap, but we have plans to auto-renew token when it expires, based on expiry date.
That is very nice.
However, it's not just for tokens. It is possible multiple requests are chained to each-other. For example Authenticate > Get account info > Create a cart with line-items > Convert the cart to order > Confirm order. Each request needs some information from one or more previous requests.
I might be developing a new feature: Cancel order. I need to create new orders to test the 'Cancel order' feature. In Insomnia I just click 'Confirm order' and it does all the other steps because the requests have been chained. I could also chain 'Cancel order' to 'Confirm order' and it becomes a one-click test.
Now, perhaps at this point this example should become an automated regression test, but it's still a feature I use daily with Insomnia.
Is it something you would consider putting on the roadmap if there is animo (I suspect there is). For me it's the only issue preventing me making the switch to Thunder Client :)
You can add the requests in collection in the order you want, and then you can run collection with Run All. which execute all the requests in order as needed.
you can group the requests into folder also.
Did you try this?
I guess this could help in some cases. But I don't think this is a very usable strategy (especially with bigger projects).
I am using collections & folders to group / give structure to the requests, however this structure doesn't have much to do with their dependencies.
As some requests are used by multiple other requests, I would have to create copies of said requests (which would of course result in more maintenance).
ok got it, will think about it, there is also request for pre-request script, will review this when i am implementing scripting.
In Postman you can chain requests using 'Pre-Request Script', however this is a bit of a hack / workaround. It's also painful to maintain because each request has it's own Pre-Request Script copy. So if this script needs a change you have to find all the requests that use this script and change it there.
That is why I have switched to Insomnia REST Client, which has chaining built in through their Tag system (which can be used anywhere!)
Ah, you just mentioned the pre-request script :)
It's a nice to have feature but as I explain in the previous comment, not a very good alternative to Insomnia's Tags..
PS: very nice extension... Especially if it's possible to commit the project to a repository (Teams feature which is beta?). This is essentially where Postman and Insomnia make their money as the sharing goes through their paid service.
Also, where is your donate button? :)
Thats a good point @saefren, you mentioned about pre-request script. haven't yet planned how to implement pre-request script . will update this discussion when i plan to implement it.
About Team Features: you can share with team via git integration https://github.com/rangav/thunder-client-support#team
its still in beta because, i am still getting good feedback for improvements as more people using this feature . So there is still room for improvements for this feature.
Hi All, started work on request linking. here is the preview screenshot of the feature. let me know your feedback
Advanced scripting will be implemented at later stage.
I'm only waiting this feature to use Thunder in my company projects!
@ricardocastanho this feature is in my priority list, will implement soon.
Hi All, Good News. This feature development is now completed. Planning to publish tomorrow.
Would anyone like to Test now and give feedback? I can upload the VSIX file here
Hi All, Good News. This feature development is now
completed. Planning to publish tomorrow.Would anyone like to
Testnow and give feedback? I can upload theVSIXfile here
I would like to test!
Please find the vsix file.
The tab is called Pre Run, available at request and collection settings
vscode-thunder-client-1.19.8.vsix.zip
please let me know your feedback.
Please find the vsix file.
The tab is called
Pre Run, available atrequestandcollectionsettingsvscode-thunder-client-1.19.8.vsix.zip
please let me know your feedback.
It works fine! But how can I get a field, like a token returned from an auth request, in the Pre Run?
Please find the vsix file.
The tab is called
Pre Run, available atrequestandcollectionsettingsvscode-thunder-client-1.19.8.vsix.zip
please let me know your feedback.
Looks good but could the requests drop-down be in alphabetical order? It would be much easier to find the request we are looking for
Edit: Probably would be better to order the requests by their order in the sidebar
Please find the vsix file. The tab is called
Pre Run, available atrequestandcollectionsettings vscode-thunder-client-1.19.8.vsix.zip please let me know your feedback.It works fine! But how can I get a field, like a
tokenreturned from an auth request, in thePre Run?
You can use Tests tab in Pre Req to save token to a variable and then access it in the main request as {{variable}}
Please find the vsix file. The tab is called
Pre Run, available atrequestandcollectionsettings vscode-thunder-client-1.19.8.vsix.zip please let me know your feedback.Looks good but could the requests drop-down be in alphabetical order? It would be much easier to find the request we are looking for
Edit: Probably would be better to order the requests by their order in the sidebar
Will update the order, to match the sidebar list order.
This feature is now implemented and published to marketplace, please update to v1.20.0
See all features released https://github.com/rangav/thunder-client-support/releases/tag/v1.20.0
Please let me know your feedback.
@rangav instead of linking it to a request, it'd be better (maybe also) linked to a variable or collection-wide. E.g. I have 10 requests where I need to login, it'd be easier to login before all requests of a collection.
Hi @hyoretsu you can add pre-request at request, folder and collection level. Please open collection settings to see Pre-Run tab
Right now we can save (part of) the response of a request (for example, an access-token, let's call this request Authenticate) to a variable, which can then be used in another request.
I'm curious – how would I do that? 😳
@metawops from the Tests tab, select Set Env Variable option
Docs here https://github.com/rangav/thunder-client-support/blob/master/README.md#setenv