# HTTP

## HTTP

### Endpoint

<div align="left"><figure><img src="/files/wXCep47PO9MgANxADzUx" alt=""><figcaption></figcaption></figure></div>

Listens for http requests on the provided `path` and `method`. `path` is an url of the form some/path/, which can be parameterized by :name for path items, and ?query\_name\&another\_query\_name for query values. Example: 'user/:name?email\&joined\_date' This creates `name`, `email` and `joined_date` output properties that one can use to get these values from the request. NOTE: All endpoints currently shares a single http server.

### Response

<div align="left"><figure><img src="/files/ffNGPMnLkLjapcbgJHlw" alt="" width="264"><figcaption></figcaption></figure></div>

Responds to an HTTP request provided by an `Http.Endpoint` event. This function must be called downstream from an `Http.Endpoint` in order to have anything to respond to.

### Fetch

<div align="left"><figure><img src="/files/wUgaOPXBUfZTDdStkmQq" alt="" width="563"><figcaption></figcaption></figure></div>

Performs a simple http/https request to the provided `url` and returns the `response` as a string, buffer or object depending on the value of `response type`, which can be 'text', 'buffer' or 'json'. The body input will be converted to json if it is anything other than a String or Null.

### FetchStreamed

<figure><img src="/files/v87j2SQzqljrxPVZK7oz" alt=""><figcaption></figcaption></figure>

Performs an http request to the given `url`, expecting it to respond with a SSE-stream, messages from which can be read using `Http.NextMessage`.

### NextMessage

<div align="left"><figure><img src="/files/iylzQ5YYhMtxUdDUPA68" alt="" width="341"><figcaption></figcaption></figure></div>

Reads the next message from the SSE stream. This function must be called downstream from a call to \`Http.FetchUrlStreamed\`.

## Url

### UrlEncodeFormData

<div align="left"><figure><img src="/files/FNg6xpnQB8rY4HaDbPfT" alt="" width="345"><figcaption></figcaption></figure></div>

### UrlEncodeString

<div align="left"><figure><img src="/files/jaWm3iBUP5a1P9flxa7L" alt="" width="322"><figcaption></figcaption></figure></div>

### UrlDecodeString

<div align="left"><figure><img src="/files/3Q8QwwThrl31VVwCSNXm" alt="" width="352"><figcaption></figcaption></figure></div>

### UrlDecodeComponent

<div align="left"><figure><img src="/files/oy3LxMqF3dZGW7f4709p" alt="" width="355"><figcaption></figcaption></figure></div>

## <mark style="color:orange;">Advanced</mark>

### Client

The `Http Client`module contains a lower level API for performing Http requests. Http FetchUrl `and Http FetchStreamed`  should cover most use-cases.

<figure><img src="/files/b2QARWytPbbipQ6WbOZH" alt=""><figcaption></figcaption></figure>

OpenNetworkStream

<div align="left"><figure><img src="/files/se9QcPyQFXn93GYmZLLz" alt="" width="375"><figcaption></figcaption></figure></div>

Opens a new network stream.

CreateRequest

<div align="left"><figure><img src="/files/hFCUBEfzEjZPfFr0oVUz" alt="" width="563"><figcaption></figcaption></figure></div>

#### SendRequest

<div align="left"><figure><img src="/files/TP4IdugNzEsN0g5nhLXK" alt="" width="330"><figcaption></figcaption></figure></div>

#### ResponseBodyStream

<div align="left"><figure><img src="/files/Hy0cujlBudQcwCFaND2H" alt="" width="563"><figcaption></figcaption></figure></div>

Streams content from a response body as descrete events.

ResponseStatus

<div align="left"><figure><img src="/files/LQIK38WsqNnER9krklji" alt="" width="563"><figcaption></figcaption></figure></div>

ResponseHeaders

<div align="left"><figure><img src="/files/YIUTP5GrVWEnfOdnI3Av" alt="" width="563"><figcaption></figcaption></figure></div>

ResponseBody

<div align="left"><figure><img src="/files/ep9SBzQ4d5mR9fRn3rJI" alt="" width="563"><figcaption></figcaption></figure></div>


---

# 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://docs.midio.com/midio-docs/built-in-nodes/http.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.
