Skip to content

Request Command

Léo Peyronnet edited this page Jul 15, 2024 · 1 revision

The request command makes a request to the specified resource.

Usage

itcli request <method> <url> [options]

Parameters

  • method: The method to use when executing the request. See the table below for choices and descriptions.
  • url: The URL where to send the request.

Options

  • -c or --content: Only outputs the content of the response. Default: False.
  • -h or --help: Shows help text.

Method Choices

Value Description
Get Retrieves data from the specified URL
Post Submits data to the specified URL
Put Updates data at the specified URL
Delete Deletes data at the specified URL
Head Retrieves headers from the specified URL without the body
Options Retrieves supported HTTP methods from the specified URL
Patch Applies partial modifications to data at the specified URL
Merge Merges data with the resource at the specified URL
Copy Copies data from the specified URL
Search Searches for data at the specified URL

Examples

Basic Usage

To make a basic GET request to a URL:

itcli request get https://example.com

POST Request with Content Output

To make a POST request and only output the content of the response:

itcli request post https://example.com --content

Tip

You can save the content of the response to text file by using itcli request post https://example.com --content > response.txt

Clone this wiki locally