# Chalk Python SDK Reference: HTTP Functions
source: https://docs.chalk.ai/api-docs#section-http-functions

## `http_delete(url, headers, body, allow_redirects, timeout, verify)`
source: https://docs.chalk.ai/api-docs#http_delete

HTTP DELETE request. See [`http_request`](https://docs.chalk.ai/api-docs#http_request) for more details.

## `http_get(url, headers, body, allow_redirects, timeout, verify)`
source: https://docs.chalk.ai/api-docs#http_get

HTTP GET request. See [`http_request`](https://docs.chalk.ai/api-docs#http_request) for more details.

## `http_post(url, headers, body, allow_redirects, timeout, verify)`
source: https://docs.chalk.ai/api-docs#http_post

HTTP POST request. See [`http_request`](https://docs.chalk.ai/api-docs#http_request) for more details.

## `http_put(url, headers, body, allow_redirects, timeout, verify)`
source: https://docs.chalk.ai/api-docs#http_put

HTTP PUT request. See [`http_request`](https://docs.chalk.ai/api-docs#http_request) for more details.

## `http_request(url, method, headers, body, allow_redirects, timeout, verify)`
source: https://docs.chalk.ai/api-docs#http_request

Make an HTTP request. The return type of this function is a [`HttpResponse`](https://docs.chalk.ai/api-docs#HttpResponse), and features that are the result of this function should be annotated as such.

HttpResponse is considered to be a struct, and you may use struct accessing syntax to access fields, HttpResponse consists of

- status_code: int
- headers: map
- body: bytes or string
- final_url: string

**Parameters**

- `url`: `Underscore | str`
  The URL to send the request to. Must start with http:// or https://.
- `method`: `_HttpMethod`
  The HTTP method to use. Must be one of GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT.
- `headers`: `Underscore | Mapping[str, str] | None` = `None`
  The headers to include in the request, if any. Should take the form of a map of strings to strings. The Content-Length header is automatically added to the headers, unless you explicitly set it in the request headers.
- `body`: `Underscore | str | bytes | None` = `None`
  The body of the request, if any. Should be a string or bytes.
- `allow_redirects`: `bool` = `True`
  Whether to follow redirects. Defaults to True.
- `timeout`: `dt.timedelta | float | None` = `None`
  The timeout for the request, in seconds. If [`None`](https://docs.python.org/3/library/constants.html#None) or 0, no timeout will be set. Timeout's precision is limited to milliseconds. Defaults to None.
- `verify`: `bool | str` = `True`
  Whether to verify the server's TLS certificate, or a path to a CA bundle to use for verification. Relative paths are resolved from the applied source root at runtime. Defaults to True.

**Examples**

```python
from chalk import _
import chalk.functions as F
import datetime as dt
from chalk.functions.http import HttpResponse
@features
class User:
   id: str
   json_data: str
   resp: HttpResponse[str] = F.http_request(
       "https://example.com",
       "POST",
       headers={"Content-Type": "application/json", "X-Client-Id": "abc123", "X-Client-Secret": "xyz789"},
       body=_.json_data,
       allow_redirects=True,
       timeout=dt.timedelta(seconds=5),
       verify="certs/customer-ca-bundle.pem",
   )
   status_code: int = _.resp.status_code
   resp_body: str = _.resp.body
```
