Skip to content
Skip to content

Saved requests and variables ​

With Wirescry Pro, a panel beside the Compose tab's editor keeps a list of saved requests, fills in {{variables}} from environments you switch between, and copies a request as code. The Compose tab itself is part of the free app.

Saved requests ​

  • Save as new saves the request in the composer under the Name you give it. Without a name, it's named after its method and path, such as GET /users.
  • Click a saved request to load it into the composer. If the composer has changes that aren't saved anywhere, Wirescry asks first.
  • Update saves the composer's request over the selected one. Rename gives it the name in Name, and Delete removes it. While the composer differs from the selected request, the panel says so.

Saved requests keep their {{variables}} as written.

Import and export ​

Export saves all your saved requests as a JSON file, with their names. Import adds the requests from such a file after your own, without replacing any, and lists any it couldn't add, and why.

Exports leave out environments and their variables, since their values may be secrets. A file exported by a newer Wirescry asks you to update first.

Environments and variables ​

An environment is a named set of variables, such as dev or staging. Choose one under Environment, or No environment; New…, Rename… and Delete manage them.

Write the active environment's variables one per line, as name = value, and click Save variables (or Discard). Blank lines and lines starting with # are skipped.

text
host = api.example.com
token = abc123

Then use them as {{name}} in the URL, the headers and the body: https://{{host}}/users, Authorization: Bearer {{token}}. Spaces inside the braces are allowed: {{ token }}.

  • Send fills them in from the active environment, so what appears in Traffic has the real values.
  • Names Wirescry doesn't know are sent as written, braces and all, since a body may use {{ for other reasons. The panel lists them under the variables, such as "Not set in staging: {{token}}".
  • Values are filled in once. A value that contains {{other}} isn't filled in again.
  • Variable names use letters, digits, _, - and .. Values are one line of text.
  • If a value would put a line break in the URL or a header, or take it past Send's limits, Send refuses and says why.

Copy as ​

Copy as copies the composer's request as fetch (JavaScript), Python (the requests library) or HTTPie code, with variables filled in. The code matches what Send sends: the same headers, with the ones Wirescry sets itself left out, and nothing like a default Content-Type added. A request Send would refuse gets Send's message instead of code. For curl, send the request and use Copy as curl in the response pane.

Each format has its limits:

FormatNotes
fetchfetch can't send a body with GET or HEAD, so the code leaves it out and says so in a comment. The body is sent as bytes, so fetch doesn't add a text/plain Content-Type. Repeated headers are kept as a list.
Pythonrequests takes headers as a dictionary, so repeated headers are joined into one: with ; for Cookie and , for others. A body with characters outside ASCII is encoded as UTF-8. The code prints the status and the response text.
HTTPieNeeds HTTPie 3.2 or later, and a shell such as bash or zsh. With a body, the code removes HTTPie's own JSON Content-Type and Accept headers, unless the request sets them. HTTPie drops a backslash before :, ;, = or @ in a header value, and only takes a method made of letters; a comment in the code says when either applies.

Limits ​

Limit
Saved requests1,000, and 10 MB together
Request name200 characters
Saved URL and headers64 KB together. Send still allows 16 KB.
Saved body512 KB
Environments50, with names up to 100 characters, each different
Variables500 per environment, with names up to 100 characters and values up to 16 KB
All environments4 MB together

Where they're stored ​

Saved requests are kept in requests.json, and environments and their variables in environments.json, in the plugins/pro folder of Wirescry's data folder. Both files are unencrypted, so anyone who can read your files can read your variables, tokens included.

If one of the files can't be read, Wirescry moves it aside or keeps a copy of the original, and says so in the panel. If it can't do either, changes to that file are turned off, so the only copy is never overwritten.

When Pro is locked ​

Without an active license, the panel shows what Pro offers and how to start a trial or enter a key. The Compose tab still sends requests, but {{variables}} are sent as written.

Your saved requests and environments are kept, and come back when Pro is active again. While Pro is still reading your license, just after Wirescry starts, Send waits for it, for up to 30 seconds. If it still hasn't finished, Send stops and asks you to try again in a moment.

Pricing is at casazium.com/wirescry.