Thanks for the video. Can you also have part 2 of this video where you process the json responses and set new values of environment variables and then send 2nd http request to some another endpoint after that (using json data values from success response data).
hi Amichai, thanks for great content. just an idea to make it better , it took for times to understand why my visual Studio doesn't recognize .HTTP like yours. and then I installed REST Client extension. now it works. edit: you explained it ,sorry my fault😂
incredibly good option to send requests through your IDE to check if your application works correctly. My point of view for this http logic are, needed to be add more features to be actual usable like do something with the response body or Code (set attribute based on response message) . :D a big lesson from Amichai again :D
I'm still catching up with the rest of the group, but your comment is helpful. So, once we have the application working the way we like, is the .http-file still used in the application (to make HTTP requests,) or is it only for use in the IDE?
Cant we declare token as dynamically? For example, declare it as global variable in somewhere which requests to the authentication endpoint and fetches the token. Based on the response of auth request(from another file), it uses always the newest valid token for all endpoints.
Thank you for this great content ❤. I have just one question why you don’t use visual studio ? Or if I ask my question differently then how to use http files in visual studio and where to put token in global variables. Please help.
Insomnia Rest is also a good client. It is Open source (Apache 2.0), supports GraphQL, REST, WebSockets, SSE and gRPC. You can create test suites, load and edit OpenAPI. It is also extensible with plugins. One problem is that the official release now forces you to login (like Postman). However, you can use an older release (up to 2023.5.8) or just use a fork which cuts the login.
I find this "login trend" somewhat concerning. If I am working on an API that is internal to my organization, the last thing I need is to provide the definition for said API to a 3rd party.
Nice video. It looks like VS Code or any other IDE that has support for http files can be used a replacement for postman in a lot of cases. Still it's missing some of the features that make Postman a great tool. What I need the most is authentication (e.g. OAuth2) and token management and a way for scripting requests (e.g. calculating a challenge/reponse value).
The fact that environment variables are stored in a vs code workspace config file seems like a big no to me. On my team everyone has its own config file stuffed with plugins configurations.
It is a great way for simple requests, but when it is necessary to login and then fetch a token to reuse in future requests, this tool is not convenient
Does postman handle that better, because I had the same problem using postman? I would have to login with the browser, then copy the token and manually set the token variable.
@@geoffreyolson9720 It is not needed to perform those actions, you just need to parse response and assign extracted value to the variable. That is available in the Tests tab. Here is a short example: let responseData = pm.response.json(); pm.environment.set("categoryId", responseData[0].id); Get first element of the array and assign id value to the variable. After that the categoryId is available for the further requests
No need to perform those manual actions. There is Tests tab where the response result can be handled. To extract and assign the value to the environment variable just need to parse response: let responseData = pm.response.json(); pm.environment.set("categoryId", responseData[0].id); In the example above I get the first item and assign extracted id to the environment variable. After that the variable can be used as value for the further requests
It’s a pain only if you already have a big undocumented api. Otherwise for every api update just update the doc, realistically your api doesn’t /shouldn’t change so much that it becomes a drag, and in the end you have a doc written by a human with nuances explained, so later on your consumers waste less of your time with questions.
@@Petrovich2049 Postman will generate the collections based on an OpenAPI spec. If you are new to a proj, this can save a crazy amount of time when you need to get a workable collection online.
It is unfortunate that the variables are stored in the vscode settings instead of something like a file in the root of the httpfiles, or project root for that matter
It's basically using postman with a lot of extra steps, I think i don't need another thing to manage😅, but maybe I will have to learn this at some point of my carreer 😐
I use this extensions for a while (~2-3 years) now. This way to do and organize the requests is still highly underrated. 👍 PS: How do you to this colored marks in your screencast? Is this a post-production or do you draw them live?
Does anybody still use curl? I find it handy while working on barebone VMs. Also if you installed tools like proxyman it can trace all http/rest requests made in your system
More of a vscode question, but is it possible to have multiple workspace settings files? I.e. i want one that has all the "public" settings and a second that has user / password in gitignore (but not in the "user" settings as they are shared across many projects.)
So I can do this all in postman. What about populating the variable with a HTTP call? Say I have an API call to get a token and then want to use that token in other API calls? I can do this in Postman, can it be done with this?
@amantinband please make a play list for rest api you are teaching perfectly like beginner to masterrest api's. if not possiblle please suggest a one rest api tutorial to become master. Thank you
Can we even use this for writing tests? What’s the point of this? Just to send one request? What if we have to generate the tokens every time for sending a request? How to do that? How to store a value from a request to be sent in another?
Nah, this one needs some work. For simple rest clients, I think IDEA's http client is better, In any project i can write http files, and i can write javascript code before and after each request that can do tests, set global variables and use them in other requests. But this extension seems good for this use case... Congrats and keep it up!
I always enjoy when people who advocate for feature folders forget about them when faced with non .cs file extension :) Services folder - bad, entities folder - bad, requests folder - totally different, this one is good :)
Probably not... since this is for the VS code plugin. But, would be nice it possible. That said, many times you don't want those stored with your source. Would be nice though it if supported .env files and or environment variables and then all IDS could adopt that.
Seems like way more work for no benefit other than to avoid postman. MS Edge has basic functionality, imports collections, etx. Probably more useful than this lol
Nice share ! Is there a way to create a auth.http file so it retrieves the token + stores it in a workspace variable ? This way we should not need to manage tokens by hand.
Dislike for the clickbait. postman is much more than just a tool for sending requests. Ability to write scripts to run before and after a request, creating collections, the cli, convenient ui and much more.
It’s such a slow and heavy app, costs another subscription too. Many features you listed can be easily replicated in vs code and I’d argue more convenient to use too. But personally I’m using Obsidian instead
If you are using postman for single requests you are missing the power of it
For sure. Bruno is a good alternative too
Thanks for the video. Can you also have part 2 of this video where you process the json responses and set new values of environment variables and then send 2nd http request to some another endpoint after that (using json data values from success response data).
Wow, It will be really helpful for me.
RIP postman.
hi Amichai, thanks for great content.
just an idea to make it better , it took for times to understand why my visual Studio doesn't recognize .HTTP like yours. and then I installed REST Client extension. now it works.
edit: you explained it ,sorry my fault😂
Postman supports GRPC and more.
incredibly good option to send requests through your IDE to check if your application works correctly. My point of view for this http logic are, needed to be add more features to be actual usable like do something with the response body or Code (set attribute based on response message) . :D a big lesson from Amichai again :D
I'm still catching up with the rest of the group, but your comment is helpful. So, once we have the application working the way we like, is the .http-file still used in the application (to make HTTP requests,) or is it only for use in the IDE?
@@Jianju69 The http files are just for testing and documentation. The application code does not use those files.
Wow! Will test it out on Monday. Looks, that it's the first time I really can get rid of Postman
Thanks for the useful video. I like it. BTW is there a way to automatically fetch the token before a request?
You can have the value auto populated via a previous response: github.com/Huachao/vscode-restclient?tab=readme-ov-file#request-variables
Cant we declare token as dynamically?
For example, declare it as global variable in somewhere which requests to the authentication endpoint and fetches the token. Based on the response of auth request(from another file), it uses always the newest valid token for all endpoints.
This is the use case I would need to move many of my collections away from Postman.
@@cliffwakefield I don't think this will ever work with SSO also. Which Postman supports.
Thank you for this great content ❤.
I have just one question why you don’t use visual studio ? Or if I ask my question differently then how to use http files in visual studio and where to put token in global variables. Please help.
How do you handle secrets and making sure the token is not checked in?
Insomnia Rest is also a good client. It is Open source (Apache 2.0), supports GraphQL, REST, WebSockets, SSE and gRPC. You can create test suites, load and edit OpenAPI. It is also extensible with plugins.
One problem is that the official release now forces you to login (like Postman).
However, you can use an older release (up to 2023.5.8) or just use a fork which cuts the login.
I find this "login trend" somewhat concerning. If I am working on an API that is internal to my organization, the last thing I need is to provide the definition for said API to a 3rd party.
How to would you do the environment management in VS?
this is probably the most important thing postman can do, without this, i will not event think about switching to any tool
That will be a game changer if added to http files
Nice video. It looks like VS Code or any other IDE that has support for http files can be used a replacement for postman in a lot of cases. Still it's missing some of the features that make Postman a great tool. What I need the most is authentication (e.g. OAuth2) and token management and a way for scripting requests (e.g. calculating a challenge/reponse value).
Cool video. One Question what if I want to update the token in Environment value from a request
The fact that environment variables are stored in a vs code workspace config file seems like a big no to me. On my team everyone has its own config file stuffed with plugins configurations.
Yup. That's a bit of bs. Also would force everyone into using VS Code.
@@bogdanb904 I think env variables are handled differently on other IDES.
Also not a fan. There should be some .http specific env file similar to Node's dotenv.
Is there a way to create variable which will have dynamic values (from a response of another endpoint)?
In Postman yes, not sure about this one
Would love to see a video on how/if this can be utilized in a test setting. E.g. calling a number of endpoint in the CD pipeline, after deployment.
It is a great way for simple requests, but when it is necessary to login and then fetch a token to reuse in future requests, this tool is not convenient
Does postman handle that better, because I had the same problem using postman? I would have to login with the browser, then copy the token and manually set the token variable.
@@geoffreyolson9720 It is not needed to perform those actions, you just need to parse response and assign extracted value to the variable. That is available in the Tests tab. Here is a short example: let responseData = pm.response.json();
pm.environment.set("categoryId", responseData[0].id);
Get first element of the array and assign id value to the variable. After that the categoryId is available for the further requests
No need to perform those manual actions. There is Tests tab where the response result can be handled. To extract and assign the value to the environment variable just need to parse response: let responseData = pm.response.json();
pm.environment.set("categoryId", responseData[0].id);
In the example above I get the first item and assign extracted id to the environment variable. After that the variable can be used as value for the further requests
@@vitek0585 Exactly. Not a Postman fan, but that tool is on another level. Also standard OAuth2 authentication are handled automatically.
@@geoffreyolson9720 just use the authorization of the collection, and configure the request to inherit the token from the collection
Thanks. I never could figure out Postman.
The http file is nice, but is there a way to automatically generate it from an Open API spec? Keeping these up to date sounds like a pain.
It’s a pain only if you already have a big undocumented api. Otherwise for every api update just update the doc, realistically your api doesn’t /shouldn’t change so much that it becomes a drag, and in the end you have a doc written by a human with nuances explained, so later on your consumers waste less of your time with questions.
@@Petrovich2049 Postman will generate the collections based on an OpenAPI spec. If you are new to a proj, this can save a crazy amount of time when you need to get a workable collection online.
Thank you for the comprehensive video.
What's the software you use to add annotations to the video? I mean those neon-like rectangles and arrows.
i smashed that subscriber button and looking forward to the future vids
Please also get into how to avoid to write API keys and other secrets in the .http files.
Define an OpenAPI document. Use those tools to test the API, generate the server and client, verify requests and responses, etc.
It is unfortunate that the variables are stored in the vscode settings instead of something like a file in the root of the httpfiles, or project root for that matter
It's basically using postman with a lot of extra steps, I think i don't need another thing to manage😅, but maybe I will have to learn this at some point of my carreer 😐
Postman was SO MUCH MORE features than what you show here! So far away from „rip postman“!
I use this extensions for a while (~2-3 years) now. This way to do and organize the requests is still highly underrated. 👍
PS: How do you to this colored marks in your screencast? Is this a post-production or do you draw them live?
Live - it’s called presentify
Does anybody still use curl? I find it handy while working on barebone VMs. Also if you installed tools like proxyman it can trace all http/rest requests made in your system
Postman? There is cURL.
does it do prescript, test, or read variable values from a file etc?
haha so how about to share your api to non-dev teammate example QA to try the api?
More of a vscode question, but is it possible to have multiple workspace settings files? I.e. i want one that has all the "public" settings and a second that has user / password in gitignore (but not in the "user" settings as they are shared across many projects.)
Have you used hurl? How does it compare to http files?
If you delete postman how do you browse the internet?
So I can do this all in postman. What about populating the variable with a HTTP call? Say I have an API call to get a token and then want to use that token in other API calls? I can do this in Postman, can it be done with this?
great video - thanks!
@amantinband please make a play list for rest api you are teaching perfectly like beginner to masterrest api's. if not possiblle please suggest a one rest api tutorial to become master. Thank you
Cool but not even close to what postman offers out of the box.
Can we even use this for writing tests? What’s the point of this? Just to send one request? What if we have to generate the tokens every time for sending a request? How to do that? How to store a value from a request to be sent in another?
What about when you need to get the bearer token from request a response header? is there a way to update the env variable on the fly?
How do you overwrite the token env variable from a login post request?
So you don't have to paste the token manually in the env variables file
Thanks
What tool do you use to annotate ?
This is slick.
Another good one! :)
Thank you Amichai
postman only wins because of testing calpabilities and scripts pre and post request
ehh, probably more than that. Runner is pretty huge
What do you do about storing tokens until they are needed? I use a secure workspace in postman.
Hopefully this will support NTLM authentication in the future.
Great content
This is inferior to OpenApi specs and generating clients from that
In the case of authentication, is it possible to automatically fill in the token variable when sending the request?
Yes, check this out: github.com/Huachao/vscode-restclient?tab=readme-ov-file#request-variables
Very cool!
Superflous use of the phrase "go ahead and..." has popped up all over youtube. I wonder what's the reason behind this?
The Jetbrains IDE also has a similar plugin, however they are not fully compatible with each other :-(.
Rider supports http files by default, no external plugin needed.
@@kewqie yes but the http files are not 100% compatible
Great thanks ❤🎉
Nah, this one needs some work. For simple rest clients, I think IDEA's http client is better, In any project i can write http files, and i can write javascript code before and after each request that can do tests, set global variables and use them in other requests. But this extension seems good for this use case... Congrats and keep it up!
I always enjoy when people who advocate for feature folders forget about them when faced with non .cs file extension :)
Services folder - bad, entities folder - bad, requests folder - totally different, this one is good :)
how to stream response as I call OpenAI's API?
Things get ugly if you try to send encoded form data...
That's cool, but I personally prefer postman because of all the functionalities it has.
Are enviroment variables able to be handled the same way for .http files in Rider/VS aswell?
Is there a way to define environments and variables that works across IDE's?
Probably not... since this is for the VS code plugin. But, would be nice it possible. That said, many times you don't want those stored with your source. Would be nice though it if supported .env files and or environment variables and then all IDS could adopt that.
Is there a way to preserve cookies sent from api for the following requests?
It needs NTLM authorisation added
Hahaha! The postman team will hate this video.
To be fair postman is an excellent product with a ton of features, but I completely replaced it with http files over the past few years
What about writing to the env. after a request has been send?
@@avatar201206 great question
@@amantinbandHow can you use rest client without storing an API key in settings.json?
i dont want create files just for make request
Did you vscode or vs in your coursed please?
But how can we upload file with http files?
Dont forget to ignore files in git with sensative data
Seems like way more work for no benefit other than to avoid postman.
MS Edge has basic functionality, imports collections, etx. Probably more useful than this lol
I use insomnia these days, it's quite good
Too much of a hassle to work with GraphQL tho
I just watched the intro, and I am thinking: Please convert me!
honestly insomnia is better for defining tokens and variables
I still prefer the plain old Python requests library.
Nice share !
Is there a way to create a auth.http file so it retrieves the token + stores it in a workspace variable ?
This way we should not need to manage tokens by hand.
microsoft minion
Dislike for the clickbait. postman is much more than just a tool for sending requests. Ability to write scripts to run before and after a request, creating collections, the cli, convenient ui and much more.
It’s such a slow and heavy app, costs another subscription too. Many features you listed can be easily replicated in vs code and I’d argue more convenient to use too.
But personally I’m using Obsidian instead
Hey, does anyone know why adding in an api key header works in vs but not in vsc: X-API-KEY: thisismyverysecurekey
If the api parses your request in a case sensitive manner, you may encounter this behaviour. Rest client makes it all lowercase iirc.
Never liked postman.
The tabs system drives me crazy