> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/all/bash/curl.md).

# Curl

Transfer data with all these protocols: DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP

## Post

Basic

```bash
curl localhost:4000/api/events -X POST -d '{"event": {"type": "basic"}}' | json_pp
```

Advanced

```bash
curl https://api.mux.com/video/v1/assets \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{ "input": "[URL_TO_VIDEO_ASSET]", "playback_policy": "public" }' \
  -u {MUX_TOKEN_ID}:{MUX_TOKEN_SECRET} | json_pp
```

`json_pp` takes json and outputs pretty printed json

```bash
curl -I http://google.com #print headers returned
```

### Authorization Header

```bash
curl -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" https://api.linkedin.com/v2/me\?projection\=\(id,profilePicture,localizedHeadline,headline,vanityName\) | json_pp
```

\--user, is transformed in basic authorization header so

```
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
```

The text after the Basic keyword is a base64 encoded text string of the username:password combination provided with the --user parameter


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://openai.gitbook.io/code-cheatsheets/all/bash/curl.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
