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

# HTTP Call Block

> Make HTTP requests to external APIs and services

## Overview

The HTTP Call Block allows you to make HTTP requests to specified URLs with custom methods, headers, and body. This versatile block is essential for interacting with external APIs or services within your workflow.

<Frame>
  <img src="https://mintcdn.com/odella/I7v1Fbrp2kx7rLoj/block-reference/assets/http_call_light.png?fit=max&auto=format&n=I7v1Fbrp2kx7rLoj&q=85&s=23fa7a5d0485f53b8542d817377c643b" alt="HTTP Call Block Screenshot" className="block dark:hidden" width="716" height="422" data-path="block-reference/assets/http_call_light.png" />

  <img src="https://mintcdn.com/odella/I7v1Fbrp2kx7rLoj/block-reference/assets/http_call_dark.png?fit=max&auto=format&n=I7v1Fbrp2kx7rLoj&q=85&s=f1a4eaac4c0cb47eb4441eff41f93c97" alt="HTTP Call Block Screenshot" className="hidden dark:block" width="732" height="448" data-path="block-reference/assets/http_call_dark.png" />
</Frame>

## Inputs

<ParamField path="Method" type="string">
  The HTTP method to use for the request (GET, POST, PUT, DELETE). Only shown when "Use Input" is enabled for Method.
</ParamField>

<ParamField path="URL" type="string">
  The URL to make the HTTP request to. Only shown when "Use Input" is enabled for URL.
</ParamField>

<ParamField path="Headers" type="object">
  An object containing the headers to include in the HTTP request. Only shown when "Use Input" is enabled for Headers. Can accept a string containing JSON or an object.
</ParamField>

<ParamField path="Body" type="string">
  The body of the HTTP request. Only shown when "Use Input" is enabled for Body. Can accept a string or an object that will be stringified.
</ParamField>

## Outputs

<ResponseField name="Body" type="string">
  The raw text body of the HTTP response.
</ResponseField>

<ResponseField name="JSON" type="object">
  If the response has a content-type of application/json, this output will contain the parsed JSON object. Otherwise, this output will not be available.
</ResponseField>

<ResponseField name="Status Code" type="number">
  The HTTP status code of the response.
</ResponseField>

<ResponseField name="Headers" type="object">
  An object containing the headers from the HTTP response.
</ResponseField>

## Editor Settings

<ParamField path="Method" type="select" default="GET">
  The HTTP method to use. Options are GET, POST, PUT, or DELETE. Has an "Use Input" toggle to accept the method via input instead.
</ParamField>

<ParamField path="URL" type="string">
  The URL to make the request to. Has a "Use Input" toggle to accept the URL via input instead.
</ParamField>

<ParamField path="Headers" type="code" language="json">
  JSON object containing request headers. Has a "Use Input" toggle to accept headers via input instead.
</ParamField>

<ParamField path="Body" type="code" language="json">
  The request body. Has a "Use Input" toggle to accept body content via input instead.
</ParamField>

<ParamField path="Error on non-200 status code" type="boolean" default={true}>
  If enabled, the block will error if the response status code is not 200.
</ParamField>

## Notes

* When running in a browser environment, requests may be limited by CORS policies. If you encounter CORS issues, try using the Node executor instead.
* Headers provided via input can be either a JSON string or an object
* Body content provided via input can be either a string or an object (which will be stringified)
* The JSON output is only available when the response has a content-type of application/json

## Examples

### Example 1: Make a GET request to an API

1. Create an HTTP Call Block and set the `Method` to `GET` and the `URL` to `https://jsonplaceholder.typicode.com/todos/1`.
2. Run the flow. You should see all of the response data, such as the headers, response code, and body, in the output panel.

### Example 2: Make a POST request to an API

1. Create an HTTP Call Block and set the `Method` to `POST` and the `URL` to `https://jsonplaceholder.typicode.com/posts`. Enable the "Use Input" toggle on the "Body" setting.
2. Create an [Object Block](/block-reference/data/object) with the following content:
