# Chalk SQL Reference: HTTP Functions
source: https://docs.chalk.ai/chalksql-docs#section-http-functions

## `fetch_file(uri)`
source: https://docs.chalk.ai/chalksql-docs#fetch_file

Downloads a file from object storage (gs://, s3://, abfs://) and returns the raw bytes. Returns null on error.

**Parameters**

- `uri`: `large_string`

## `fetch_file_raw(uri)`
source: https://docs.chalk.ai/chalksql-docs#fetch_file_raw

Downloads a file from object storage (gs://, s3://, abfs://) and returns a struct with data, success, error, and metadata.

**Parameters**

- `uri`: `large_string`

## `http_request(url, method, ...)`
source: https://docs.chalk.ai/chalksql-docs#http_request

Makes an HTTP request and returns the response.

**Overloads**

#### `http_request(url, method, ...+4)`

Makes an HTTP request with string `body` and returns the response as bytes.

**Parameters**

- `url`: `large_string`
  The URL to request.
- `method`: `large_string`
  The HTTP `method`, such as 'GET' or 'POST'.
- `headers`: `map<large_string, large_string>`
  A map of HTTP header names to values.
- `body`: `large_string`
  The request `body`.
- `allow_redirects`: `bool`
  Whether to follow HTTP redirects.
- `timeout_ms`: `int64`
  The request timeout in milliseconds.

#### `http_request(url, method)`

Makes an HTTP request with optional named arguments and returns the response as bytes.

**Parameters**

- `url`: `large_string`
  The URL to request.
- `method`: `large_string`
  The HTTP `method`, such as 'GET' or 'POST'.
- `headers`: `map<large_string, large_string>` = `NULL`
  A map of HTTP header names to values.
- `body`: `large_string` = `NULL`
  The request `body`.
- `allow_redirects`: `bool` = `NULL`
  Whether to follow HTTP redirects.
- `timeout_ms`: `int64` = `NULL`
  The request timeout in milliseconds.
- `verify_peer`: `bool` = `NULL`
  Whether to verify the server's TLS certificate.
- `ca_info_path`: `large_string` = `NULL`
  The path to a CA certificate bundle used to verify the server.

#### `http_request(url, method, ...+6)`

Makes an HTTP request with string `body` and custom TLS verification.

**Parameters**

- `url`: `large_string`
  The URL to request.
- `method`: `large_string`
  The HTTP `method`, such as 'GET' or 'POST'.
- `headers`: `map<large_string, large_string>`
  A map of HTTP header names to values.
- `body`: `large_string`
  The request `body`.
- `allow_redirects`: `bool`
  Whether to follow HTTP redirects.
- `timeout_ms`: `int64`
  The request timeout in milliseconds.
- `verify_peer`: `bool`
  Whether to verify the server's TLS certificate.
- `ca_info_path`: `large_string`
  The path to a CA certificate bundle used to verify the server.

#### `http_request(url, method, ...+4)`

Makes an HTTP request with binary `body` and returns the response as bytes.

**Parameters**

- `url`: `large_string`
  The URL to request.
- `method`: `large_string`
  The HTTP `method`, such as 'GET' or 'POST'.
- `headers`: `map<large_string, large_string>`
  A map of HTTP header names to values.
- `body`: `large_binary`
  The request `body`.
- `allow_redirects`: `bool`
  Whether to follow HTTP redirects.
- `timeout_ms`: `int64`
  The request timeout in milliseconds.

#### `http_request(url, method, ...+6)`

Makes an HTTP request with binary `body` and custom TLS verification.

**Parameters**

- `url`: `large_string`
  The URL to request.
- `method`: `large_string`
  The HTTP `method`, such as 'GET' or 'POST'.
- `headers`: `map<large_string, large_string>`
  A map of HTTP header names to values.
- `body`: `large_binary`
  The request `body`.
- `allow_redirects`: `bool`
  Whether to follow HTTP redirects.
- `timeout_ms`: `int64`
  The request timeout in milliseconds.
- `verify_peer`: `bool`
  Whether to verify the server's TLS certificate.
- `ca_info_path`: `large_string`
  The path to a CA certificate bundle used to verify the server.

#### `http_request(url, method)`

Makes an HTTP request with default options and returns the response as bytes.

**Parameters**

- `url`: `large_string`
  The URL to request.
- `method`: `large_string`
  The HTTP `method`, such as 'GET' or 'POST'.
