If you're to work with the code examples discussed in this article, you should have the following installed in your system: This article talks about how you can fast-track API development with Insomnia REST Client. You can take advantage of Insomnia to test HTTP-based RESTful APIs or even GraphQL APIs. It's a free cross-platform desktop framework that incorporates a user-friendly user interface and sophisticated features, such as security helpers, code creation, and environment variables. You can use Insomnia for testing RESTful as well as GraphQL APIs. Insomnia is yet another popular, fast REST client that's available for Mac, Windows, and Linux. Postman is the de facto industry-standard tool for testing and developing APIs. There are plenty of API testing tools around. It would help if you had API testing as part of your testing strategy to test your application's core business rules and help deliver better software faster. You must test your APIs before releasing them for the clients or end-users to consume. Today's applications thrive on a lot on APIs - most of today's applications are API-based.ĪPI is an acronym for Application Programming Interface and acts as the middle layer between the presentation layer and the database layer. You can take advantage of APIs to enable communication between systems and the data exchange between them. Just hit the Send button and the token will be retrieved automatically if it is not available.Over the past few years, APIs evolved to become the center of software development. One thing that Insomnia does better than Postman is that you don’t have to retrieve the token first. The other settings under the Advanced Options can be left as default. But for most OAuth flows it’s a mandatory setting. It’s easily missed because it’s hidden by default. I would expect it to be part of the standard options. I wonder why the scope is under the advanced options. Then expand the Advanced Options and enter the Scope. Also fill in the Client Id and Client Secret. Just click on the variable and select the one you want to use from the popup. If you use an environment variable, then make sure to select the correct one. Then fill in the Access Token URL, it should be the same as used in Postman. Select Client Credentials from the Grant Type options. Here is an example of a very simple environment settings file. They are basically JSON files and that works pretty easily. Insomnia also supports environments with variables to be used in the requests. And because I figured that more people might be using Insomnia, I wanted to include my findings here. So I decided to install this tool and give it a shot. I’ve got a question from somebody struggling with setting up the client credentials flow with Insomnia. To be honest, this tool is completely new to me. I assume further screenshots are not required to show how to open the collection or folder settings. Then you only have to select the current token once on collection or folder level and you can use it for all requests inside the folder or collection until the token has expired. All requests inside a folder or collection can inherit the authorization settings from their parent. Instead, I would recommend configuring the Authorization on folder or collection level. So far, I’ve only talked about setting the authorization per request. Configuring Authorization on a parent level
0 Comments
Leave a Reply. |