> For the complete documentation index, see [llms.txt](https://cgps.gitbook.io/data-flo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cgps.gitbook.io/data-flo/reference-guide/import-file-from-http-request.md).

# import-file-from-http-request

## Description

<mark style="color:purple;">`import-file-from-http-request`</mark> *adaptor imports a file from an HTTP request.*

## Inputs

**`url`**\
Type: `text`\
Required: Yes\
The URL of the resource you want to fetch.

**`method`**\
Type: `text`\
Required: No\
The request method, e.g., `GET`, `POST`. The default is `GET`

**`headers`**\
Type: `dictionary`\
Required: No\
Any headers you want to add to the request.

**`body`**\
Type: `file`\
Required: No\
Any body that you want to add to the request.

## Outputs

**`response body`**\
Type: `file`\
The response body.

**`status code`**\
Type: `number`\
The response status code.

**`response headers`**\
Type: `dictionary`\
The response headers.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`url:` <https://jsonplaceholder.typicode.com/todos/1>

#### Outputs:

`response body`:

```
{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
```

`status code`: 200

`response headers`:

```
cache-control -> max-age=43200
content-type -> application/json; charset=utf-8
server -> cloudflare
transfer-encoding -> chunked
```

-> imported a JSON file using an HTTP request into Data-Flo.

## Use Cases

* Enables users to retrieve files from a server for further processing and transformation in Data-flo.
