DEV Community

Roman Vladimirov
Roman Vladimirov

Posted on • Edited on

ArdorQuery release 0.0.6

ArdorQuery it is a tool for testing HTTP(s) endpoints (inspired from Postman and cURL) oriented on working from keyboard. If you want to know the purpose of the application, you can check other post. In this post I tell you about important updates happend in new version 0.0.6. You can download the new version from this link.

Route field

In modern RESTful services widely used URL with dynamic segments. As example if I have this pattern http://../api/{dynamic-segment}/id.
This approach can be used and for routing (like http://../api/product/id , http://../api/user/id) and as replace for URL parameter (like http://../api/1/id , http://../api/500/id).
For adding dynamic segments in ArdorQuery you need create named dynamic segment in url in format {nameofsegment}.
Example: url https://mysite.com/api/product/{id}/item. After it need create new line (Ctrl-Enter) and type route id=some value. Examples route id=10, route id=8bfe1522–225d-4e30–8c8a-4a7c01209995.
Before the HTTP(s) request is made, the URL will be formatted and any defined dynamic segments will be replaced with the corresponding defined values. Full example:
url https://mysite.com/api/{objectid}/{id}/item
route id=10
route objectid=product
In final it will be URL: https://mysite.com/api/product/10/item
You can also use a segment with the same name more than once, in which case all segments will be replaced with the same corresponding value from the field. Example https://mysite.com/api/{id}/somepath/{id}/prefix/{id}
Of course you can combined route fields with other URL parameters in param fields if you have complex URL.

Generating images

For the most part, you work with one of the bug tracking systems (for example, JIRA) and there are times when you need to
simply to share information about a request without a response, for example, to report the time it took to complete or an error in the request.
Then you can generate an image containing the request settings, the contents of the summary section and the response headers as an image.
To do this, you just need to press Ctrl-8 to save the result to a file and Alt-8 to save the result to the clipboard.
The result might look something like the screenshot below.
Generated summary and headers

OpenAPI exporter

If you need to work with a RESTful API and it supports the description in OpenAPI v3 format, then you can greatly simplify
a life with the help of a new window in the application called “Export from OpenAPI”. In this window you can by specifying the URL address of the scheme and the base address, and generate all the fields of the request for its execution in the main application window. A small disclaimer, in the current version only JSON-based schemas are supported.
Press the F6 button to open the “Export from OpenAPI” window.
In the window, you need to fill in the fields “Scheme URL” (this is the address where the OpenAPI scheme of your service is located) and “Base URL” (this is the address for which the request will be generated).
Then press Ctrl-Z to load the schema and get a list of possible queries.
When the list is received, you can select the request in the list and click on it. After clicking on the request, the export window will close
and in the main window a new request will be created in which the fields from the previously selected request will be generated.
If the list is too large, you can filter the list by entering the desired name in the Filter field. Filtering works by method, route and description, you can also enter multiple filters separated by a space e.g. “get Apples” will filter out all requests with a GET method and Apples in the route or description.
The export window also has its own keyboard commands, the help for which is the same as in the main window opens with the F1 key. The scheme is loaded once and then you can return to the export window again for generating other requests to fulfill. In addition, you can save field settings and in further load them from the Saved Options tab. To save the current set of fields, press Ctrl-Insert. If you want to save settings with a human readable name just put it in the “Title” field otherwise it will be given the same as “Scheme URL”.
OpenAPI window

Top comments (0)