gurl edit

Edit a saved request using your default editor or command-line flags.

Usage

gurl edit [name] [flags]

Description

The edit command modifies a saved request. Without flags, it opens the request in your default editor. With flags, it updates specific fields directly.

Flags

FlagShortDefaultDescription
--method-XnoneHTTP method
--url-unoneRequest URL
--header-HnoneAdd HTTP header
--remove-headernoneRemove a header by name
--body-dnoneRequest body
--collection-cnoneMove to collection
--tag-tnoneAdd a tag
--pre-scriptnoneScript to run before request
--post-scriptnoneScript to run after request
--assert-anoneAdd an assertion

Aliases

  • e

Examples

Edit in default editor

gurl edit "my-request"

Opens “my-request” in your default editor.

Change URL

gurl edit "my-request" --url https://api.new-example.com/users

Updates the URL for the request.

Update method and headers

gurl edit "api-users" -X POST -H "Authorization: Bearer new-token"

Changes the method to POST and updates the Authorization header.

Add pre-script

gurl edit "auth-request" --pre-script "./auth-script.sh"

Adds a pre-request script to the “auth-request”.

See also