> ## 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: Inputs, Cost & CLI Example

> Calling a public API directly with custom HTTP method, headers, cookies, query params, and body. Includes inputs, outputs, costs, and Deepline CLI examples.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=generic_http_request:{"url":"{{url}}"}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                           | Type                                                                     | Required | Default | Description                                                                                                                                          |
| ------------------------------ | ------------------------------------------------------------------------ | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payload.url`                  | `string`                                                                 | Yes      |         | Absolute http/https URL to call. Private and localhost targets are blocked. Auth-like request values require https.                                  |
| `payload.method`               | `"GET" \| "POST" \| "PUT" \| "PATCH" \| "DELETE" \| "HEAD" \| "OPTIONS"` | No       |         | HTTP method. Defaults to GET.                                                                                                                        |
| `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.                                                                                              |
| `payload.follow_redirects`     | `boolean`                                                                | No       |         | Whether to follow redirects. Defaults to true.                                                                                                       |

### Allowed values

| Field            | Allowed values                                             |
| ---------------- | ---------------------------------------------------------- |
| `payload.method` | `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS` |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "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."
      },
      "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 Schema

| Name                   | Type                     | Required | Default | Description |
| ---------------------- | ------------------------ | -------- | ------- | ----------- |
| `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={null}
  {
    "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>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute generic_http_request --payload '{
  "url": "string"
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Cost

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