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

# HttpRequest

The `<HttpRequest>` verb sends a request to the external servers. It consists of 2 child nodes `<Request>` and `<Response>`

## Attributes

<table>
  <thead>
    <tr>
      <th>ATTRIBUTE</th>
      <th>DESCRIPTION</th>
      <th>OPTIONS</th>
      <th>DEFAULT</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>async</code></td>
      <td> Defines if TeXML process should wait for the request response. When it is set to false, the callback will be sent to the action URL, when the request is processed </td>

      <td />

      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>action</code></td>
      <td> Defines the action url that will be used to send the callback when the request is processed (only if async is set to false) </td>

      <td />

      <td>-</td>
    </tr>
  </tbody>
</table>

## Child verbs/nouns

<table>
  <thead>
    <tr>
      <th>NOUN/VERB</th>
      <th>DESCRIPTION</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>Request</code></td>
      <td> The `<Request>` node defines all the attributes of the request. It can have 2 child nodes `<Headers>` and `<Body>` </td>
    </tr>

    <tr>
      <td><code>Response</code></td>
      <td> The `<Response>` node defines all the attributes of the response. It can have 2 child nodes `<Headers>` and `<Body>` </td>
    </tr>
  </tbody>
</table>

## Examples

```xml theme={null}
<Response>
    <HttpRequest async=”true”>
        <Request url="https://example.com" method="POST">
        <Headers>
            <Header>
                <Key>Authorization</Key>
                <Value>Bearer API_key</Value>
            </Header>
            <Header>
                <Key>Content-Type</Key>
                <Value>application/json</Value>
            </Header>
        </Headers>
        <Body>
        <![CDATA[
                {
                    "from":{{From}}
                }
                ]]>
        </Body>
        </Request>
    </HttpRequest>
</Response>
```

```xml theme={null}
<Response>
    <HttpRequest  async=”false” action="https://example.com">
        <Request url="https://example.com" method="POST">
        ...
        </Request>
        <Response>
            <Type>JSON</Type>
            <StatusCode>200</StatusCode>
            <Content>
                <Field>
                    <Name>contact.name.first</Name>
                    <Value>first_name</Value>
                </Field>
                <Field>
                    <Name>contact.name.last</Name>
                    <Value>last_name</Value>
                </Field>
            </Content>
        </Response>
    </HttpRequest>
</Response>
```

## Expected callbacks

When the HTTP request completes, a callback is sent to the `action` URL. See [HTTP Request Callback](/api-reference/callbacks/texml-http-request) for the full payload reference.
