Nushell

Nushell Niceties: Using Request Headers With HTTP Commands

Posted on by  
Hubert Klein Ikkink

The nice thing about the http command in Nushell is that you can interact with HTTP endpoints without the need to install any external tools. You can use several subcommands like get, post, put, delete and patch. Each of these commands has the options to specify request headers. You can use the option --headers or the short version -H followed by a list of header keys and values.

Continue reading →

Nushell Niceties: Posting JSON to an HTTP Endpoint

Posted on by  
Hubert Klein Ikkink

The http command in Nushell can be used to interact with HTTP endpoints. You can post data to an endpoint using the post subcommand. If you want to post JSON data than you can simply use a record data structure and use the argument --content-type application/json (or the shorthand -t application/json). Nushell will automatically convert the record data structure to JSON and use it as the body of the HTTP request.

Continue reading →

Nushell Niceties: Getting The HTTP Response Status

Posted on by  
Hubert Klein Ikkink

Nushell has a built-in command to invoke HTTP requests: http. You don’t need an external tool like curl or httpie to make HTTP requests. There a lot of options to use with the http command. One of them is the --full or shorter -f option to return a table with extra details of the HTTP request and response. The request and response headers, the body and status are returned in the table. You can easily get information from the table with all the default selection options for a table structure.

Continue reading →

shadow-left