> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Generic HTTP: Request

> Fetch a URL or call any public API with your own HTTP method, headers, cookies, query parameters and body, and get the response.

Fetch a URL or call any public API with your own HTTP method, headers, cookies, query parameters and body, and get the response.

> [!NOTE]
>
> Tool ID: `generic_http_request`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'generic_http_request',
  {
    "url": "https://example.com"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute generic_http_request --input '{
  "url": "https://example.com"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "provider": "generic_http",
  "operation": "generic_http_request",
  "method": "example",
  "requested_url": "https://example.com",
  "final_url": "https://example.com",
  "status_code": 123,
  "ok": true,
  "headers": {},
  "data": {}
}
```

Use `deepline describe generic_http_request --json` for the latest machine-readable contract.

## Input reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.url` | `string` | Yes | — | Absolute http/https URL to call. Private and localhost targets are blocked. Auth-like request values require https. Minimum length: 1. |
| `payload.method` | `"GET" \| "POST" \| "PUT" \| "PATCH" \| "DELETE" \| "HEAD" \| "OPTIONS"` | No | — | HTTP method. Defaults to GET. Allowed: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`. |
| `payload.query` | `record` | No | — | — |
| `payload.headers` | `record` | No | — | Additional request headers. Transport headers like Host are blocked. Auth-like headers require https and reflected values are redacted from results. |
| `payload.cookies` | `record` | No | — | Cookie key/value pairs serialized into the Cookie header. Cookies require https and reflected values are redacted from results. |
| `payload.body_json` | `unknown` | No | — | JSON-serializable request body. Auth-like fields require https and reflected values are redacted from results. |
| `payload.body_text` | `string` | No | — | Raw text request body. |
| `payload.body_form_urlencoded` | `record` | No | — | — |
| `payload.timeout_ms` | `integer` | No | — | Per-request timeout in milliseconds. Defaults to 30000. Minimum: 100. Maximum: 120000. |
| `payload.follow_redirects` | `boolean` | No | — | Whether to follow redirects. Defaults to true. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "description": "Absolute http/https URL to call. Private and localhost targets are blocked. Auth-like request values require https.",
        "minLength": 1
      },
      "method": {
        "type": "string",
        "description": "HTTP method. Defaults to GET.",
        "enum": [
          "GET",
          "POST",
          "PUT",
          "PATCH",
          "DELETE",
          "HEAD",
          "OPTIONS"
        ]
      },
      "query": {
        "type": "object",
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "array",
              "minItems": 1,
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            }
          ]
        }
      },
      "headers": {
        "type": "object",
        "description": "Additional request headers. Transport headers like Host are blocked. Auth-like headers require https and reflected values are redacted from results.",
        "additionalProperties": {
          "type": "string"
        }
      },
      "cookies": {
        "type": "object",
        "description": "Cookie key/value pairs serialized into the Cookie header. Cookies require https and reflected values are redacted from results.",
        "additionalProperties": {
          "type": "string"
        }
      },
      "body_json": {
        "description": "JSON-serializable request body. Auth-like fields require https and reflected values are redacted from results."
      },
      "body_text": {
        "type": "string",
        "description": "Raw text request body.",
        "allowsTemplatePlaceholders": true
      },
      "body_form_urlencoded": {
        "type": "object",
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "array",
              "minItems": 1,
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            }
          ]
        }
      },
      "timeout_ms": {
        "type": "integer",
        "description": "Per-request timeout in milliseconds. Defaults to 30000.",
        "minimum": 100,
        "maximum": 120000
      },
      "follow_redirects": {
        "type": "boolean",
        "description": "Whether to follow redirects. Defaults to true."
      }
    },
    "required": [
      "url"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.provider` | `"generic_http"` | Yes | — | — |
| `result.operation` | `"generic_http_request"` | Yes | — | — |
| `result.method` | `string` | Yes | — | — |
| `result.requested_url` | `string` | Yes | — | — |
| `result.final_url` | `string` | Yes | — | — |
| `result.status_code` | `integer` | Yes | — | — |
| `result.ok` | `boolean` | Yes | — | — |
| `result.headers` | `record` | Yes | — | — |
| `result.data` | `unknown` | Yes | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "provider": {
        "type": "string",
        "const": "generic_http"
      },
      "operation": {
        "type": "string",
        "const": "generic_http_request"
      },
      "method": {
        "type": "string"
      },
      "requested_url": {
        "type": "string"
      },
      "final_url": {
        "type": "string"
      },
      "status_code": {
        "type": "integer"
      },
      "ok": {
        "type": "boolean"
      },
      "headers": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        }
      },
      "data": {}
    },
    "required": [
      "provider",
      "operation",
      "method",
      "requested_url",
      "final_url",
      "status_code",
      "ok",
      "headers",
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.