---
title: "HTTPGET_TEXT"
description: "The HTTPGET_TEXT SQL function retrieve the HTTP response on a GET from a URL as a text (varchar2)."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/httpget-text
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/httpget-text
updated: 2026-09-22T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> HTTPGET_TEXT[HTTPGET_TEXT]:::quoted
    HTTPGET_TEXT --> End((END))
```

## Purpose
The `HTTPGET_TEXT` SQL function retrieve the HTTP response on a GET from a URL as a text (`varchar2`).

The URL must be accessible. Use the `NativePlatformScalarRequest` view on cloud applications to directly access their APIs with credentials and rate limiters.

See also [[HTTPGET]] and [[HTTPPOST]].

Parameters:
- URL (`varchar2`): the URL to GET the data from.
- Encoding (optional, `varchar2`): the encoding from the data to receive as described in [[Character Set Encoding]]. Defaults to `UTF8`.
- Time-out (optional, `int64`): the number of milliseconds to wait for the counterparty to answer. Defaults to 30 000.
- Ignore web error (optional, `boolean`): whether a failed retrieval returns `null` instead of terminating the statement. Defaults to `false`.

Returns: the collected data as `varchar2`.

Every attempt is registered in [[Invantive-HTTPDOWNLOADHISTORY]] with its HTTP status code and error message, whether it succeeded, failed or was ignored. That is where the reason for a `null` is found when `ignore web error` is set.

## Examples
The following example retrieves the text from the HTTP response on `https://cloud.invantive.com` as UTF8:
```sql
select httpget_text('https://cloud.invantive.com')

----------------
<!DOCTYPE html>
```
The following example retrieves the text from the HTTP response on `https://cloud.invantive.com` as EBCDIC (Spain-Euro):
```sql
select httpget_text('https://cloud.invantive.com', 'IBM01145')

----------------
à|äèß&áÇÈ_%
```