# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cgps.gitbook.io/data-flo/reference-guide/import-file-from-http-request.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
