# Curl HTTP Request
> Make a real HTTP request from the cloud and get back the status code, headers, and body instantly.

## Agent Summary
- FQN: `curl-http-request.underscoredone.com`
- Category: network
- Operator: _done
- Version: 1.0.0
- Endpoints: 1
- Pricing: $0.01
- Page: https://underscoredone.com/curl_http_request
- Markdown: https://curl-http-request.underscoredone.com/index.md
- OpenAPI: https://curl-http-request.underscoredone.com/openapi.json

## Service URL
https://curl-http-request.underscoredone.com

## Use Case
Send an HTTP request to any URL from our servers and receive the full response — including the status code, all response headers, and the body content. Supports GET, POST, PUT, PATCH, DELETE, and HEAD. Automatically follows up to 3 redirects. Useful for testing endpoints, verifying servers are responding correctly, debugging redirect chains, or fetching raw data without needing a local setup.

## How to Call
Send a JSON body with a 'url' (required, must start with http:// or https://) and an optional 'method' field (defaults to GET). The response includes 'statusCode' (integer), 'headers' (object of key-value strings), 'body' (string, may be HTML, JSON, or plain text), 'durationMs' (how long the request took in milliseconds), and 'error' (null on success, or a plain-English message if the request could not be completed). Do not use this for private or internal network addresses. Redirects are followed automatically up to 3 times. If the target server is unreachable or times out, a 400 error is returned with a description of what went wrong.

## Endpoint
| Method | URL | Price | Description |
|--------|-----|-------|-------------|
| POST | `https://curl-http-request.underscoredone.com/curl` | $0.01/request | Fetch any URL from the cloud and return its full response. |

## Example Request
```json
{
  "url": "https://httpbin.org/get",
  "method": "GET"
}
```

## Example Response
```json
{
  "api_version": "1.0.0",
  "url": "https://httpbin.org/get",
  "method": "GET",
  "statusCode": 200,
  "headers": {
    "content-type": "application/json",
    "content-length": "307",
    "server": "gunicorn/19.9.0"
  },
  "body": "{\n  \"args\": {}, \n  \"headers\": {\n    \"Host\": \"httpbin.org\"\n  }, \n  \"url\": \"https://httpbin.org/get\"\n}",
  "durationMs": 312,
  "redirectChain": [],
  "error": null
}
```

## Errors
| Status | Meaning |
|--------|---------|
| 400 | The URL was missing, malformed, pointed to a blocked address, timed out, or the remote server could not be reached. |
| 422 | A required field is missing or the wrong type — for example, leaving 'url' blank or passing a number instead of text. |
| 402 | Payment required — send X-PAYMENT header |
