---
product: Chilkat
product_version: 11.7.0
language: dataflex
language_label: DataFlex
class: HttpResponse
license: bundle
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/dataflexHttpResponseRef.html
---
# Chilkat HttpResponse — DataFlex — v11.7.0

> Chilkat 11.7.0 · language=dataflex · class=HttpResponse
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/HttpResponse.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/dataflex/guide.md`.

## Purpose

**Inspect HTTP status, headers, cookies, redirects, and response bodies.**

`Chilkat.HttpResponse` represents an HTTP response returned by certain `Chilkat.Http` methods. It provides access to the response status line, status code, headers, cookies, charset, content length, body bytes, body text, full MIME response, redirect URL, and helper methods for saving or loading the response body into Chilkat objects such as `BinData`, `StringBuilder`, `JsonObject`, `JsonArray`, and `Xml`.

**Status and reason**

Read the HTTP status code, status line, and related response information to determine whether the request succeeded, redirected, or failed.

**Headers and cookies**

Inspect response headers, retrieve individual header values, and access cookies returned by the server.

**Body as text or bytes**

Get the response body as raw bytes or decoded text, using the response charset information when appropriate.

**Structured body loading**

Load the body directly into `JsonObject`, `JsonArray`, `Xml`, `BinData`, or `StringBuilder` objects for further processing.

**Redirect information**

Access redirect-related information such as the redirect URL when the server responds with a redirect status.

**Save and inspect responses**

Save body content, inspect the full MIME-style response, and use response metadata for diagnostics, logging, or API troubleshooting.

**Common pattern:** Send a request with `Chilkat.Http`, check the `StatusCode`, inspect headers or cookies as needed, then retrieve the body in the form best suited to the response content: text, bytes, `BinData`, `StringBuilder`, JSON, or XML. Use `HttpResponse` for response inspection; use `Chilkat.Http` for the actual network request.

For an extended overview, see [HttpResponse Class Overview](https://www.chilkatsoft.com/httpresponse_class_overview.asp).

## Object creation, unlocking and error handling

**Object Creation**

```dataflex
// (Dataflex programs use the 32-bit Chilkat ActiveX)
Handle hoHttpResponse
Get Create(RefClass(cComChilkatHttpResponse)) to hoHttpResponse
```

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in DataFlex.

How failure is reported depends on the method's return type and is stated in the note under each method below. In every case the diagnostic text is in the `LastErrorText` property of the object whose method was called.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `Function ComDebugLogFilePath Returns String Procedure Set ComDebugLogFilePath String value` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastBinaryResult` | `Function ComLastBinaryResult Returns Variant` | read-only | This property is mainly used in SQL Server stored procedures to retrieve binary data from the last method call that returned binary data. |
| `LastErrorHtml` | `Function ComLastErrorHtml Returns String` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `Function ComLastErrorText Returns String` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `Function ComLastErrorXml Returns String` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `Function ComLastMethodSuccess Returns Boolean Procedure Set ComLastMethodSuccess Boolean value` | read/write | Indicates the success or failure of the most recent method call: `True` means success, `False` means failure. |
| `LastStringResult` | `Function ComLastStringResult Returns String` | read-only | In SQL Server stored procedures, this property holds the string return value of the most recent method call that returns a string. |
| `LastStringResultLen` | `Function ComLastStringResultLen Returns Integer` | read-only | The length, in characters, of the string contained in the LastStringResult property. |
| `VerboseLogging` | `Function ComVerboseLogging Returns Boolean Procedure Set ComVerboseLogging Boolean value` | read/write | If set to `True`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `Function ComVersion Returns String` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `Body` | property, read-only | `Function ComBody Returns Variant` |
| `BodyQP` | property, read-only | `Function ComBodyQP Returns String` |
| `BodyStr` | property, read-only | `Function ComBodyStr Returns String` |
| `Charset` | property, read-only | `Function ComCharset Returns String` |
| `ContentLength` | property, read-only | `Function ComContentLength Returns Integer` |
| `DateStr` | property, read-only | `Function ComDateStr Returns String` |
| `Domain` | property, read-only | `Function ComDomain Returns String` |
| `FinalRedirectUrl` | property, read-only | `Function ComFinalRedirectUrl Returns String` |
| `FullMime` | property, read-only | `Function ComFullMime Returns String` |
| `Header` | property, read-only | `Function ComHeader Returns String` |
| `NumCookies` | property, read-only | `Function ComNumCookies Returns Integer` |
| `NumHeaderFields` | property, read-only | `Function ComNumHeaderFields Returns Integer` |
| `StatusCode` | property, read-only | `Function ComStatusCode Returns Integer` |
| `StatusLine` | property, read-only | `Function ComStatusLine Returns String` |
| `StatusText` | property, read-only | `Function ComStatusText Returns String` |
| `UncommonOptions` | property, read/write | `Function ComUncommonOptions Returns String Procedure Set ComUncommonOptions String value` |
| `GetBodyBd` | method | `Function ComGetBodyBd cComChilkatBinData binData Returns Boolean` |
| `GetBodyJarr` | method | `Function ComGetBodyJarr cComChilkatJsonArray jarr Returns Boolean` |
| `GetBodyJson` | method | `Function ComGetBodyJson cComChilkatJsonObject json Returns Boolean` |
| `GetBodySb` | method | `Function ComGetBodySb cComChilkatStringBuilder sb Returns Boolean` |
| `GetBodyXml` | method | `Function ComGetBodyXml cComChilkatXml xml Returns Boolean` |
| `GetCookieDomain` | method | `Function ComGetCookieDomain Integer index Returns String` |
| `GetCookieExpiresStr` | method | `Function ComGetCookieExpiresStr Integer index Returns String` |
| `GetCookieName` | method | `Function ComGetCookieName Integer index Returns String` |
| `GetCookiePath` | method | `Function ComGetCookiePath Integer index Returns String` |
| `GetCookieValue` | method | `Function ComGetCookieValue Integer index Returns String` |
| `GetHeaderField` | method | `Function ComGetHeaderField String fieldName Returns String` |
| `GetHeaderFieldAttr` | method | `Function ComGetHeaderFieldAttr String fieldName String attrName Returns String` |
| `GetHeaderName` | method | `Function ComGetHeaderName Integer index Returns String` |
| `GetHeaderValue` | method | `Function ComGetHeaderValue Integer index Returns String` |
| `LoadTaskResult` | method | `Function ComLoadTaskResult cComChilkatTask task Returns Boolean` |
| `SaveBodyBinary` | method | `Function ComSaveBodyBinary String path Returns Boolean` |
| `SaveBodyText` | method | `Function ComSaveBodyText Boolean bCrlf String path Returns Boolean` |
| `UrlEncParamValue` | method | `Function ComUrlEncParamValue String encodedParamString String paramName Returns String` |

## Properties

### HttpResponse.Body

`Chilkat 11.7.0 · dataflex · HttpResponse · Body · property · read-only`

```dataflex
Function ComBody Returns Variant
```

The response body returned as a byte array.

### HttpResponse.BodyQP

`Chilkat 11.7.0 · dataflex · HttpResponse · BodyQP · property · read-only`

```dataflex
Function ComBodyQP Returns String
```

The same as the Body property, but returned as a quoted-printable encoded string.

### HttpResponse.BodyStr

`Chilkat 11.7.0 · dataflex · HttpResponse · BodyStr · property · read-only`

```dataflex
Function ComBodyStr Returns String
```

The response body returned as a string.

### HttpResponse.Charset

`Chilkat 11.7.0 · dataflex · HttpResponse · Charset · property · read-only`

```dataflex
Function ComCharset Returns String
```

The response charset, such as `iso-8859-1`, if applicable. Obviously, responses for GIF and JPG files will not have a charset.

### HttpResponse.ContentLength

`Chilkat 11.7.0 · dataflex · HttpResponse · ContentLength · property · read-only`

```dataflex
Function ComContentLength Returns Integer
```

The content length of the response, in bytes.

### HttpResponse.DateStr

`Chilkat 11.7.0 · dataflex · HttpResponse · DateStr · property · read-only`

```dataflex
Function ComDateStr Returns String
```

Returns the content of the Date response header field in RFC822 date/time string format.

### HttpResponse.Domain

`Chilkat 11.7.0 · dataflex · HttpResponse · Domain · property · read-only`

```dataflex
Function ComDomain Returns String
```

The domain of the HTTP server that created this response.

### HttpResponse.FinalRedirectUrl

`Chilkat 11.7.0 · dataflex · HttpResponse · FinalRedirectUrl · property · read-only · since 9.5.0.49`

```dataflex
Function ComFinalRedirectUrl Returns String
```

Returns the redirect URL for 301/302 responses.

### HttpResponse.FullMime

`Chilkat 11.7.0 · dataflex · HttpResponse · FullMime · property · read-only`

```dataflex
Function ComFullMime Returns String
```

Returns the full MIME (header + body) of the HTTP response.

### HttpResponse.Header

`Chilkat 11.7.0 · dataflex · HttpResponse · Header · property · read-only`

```dataflex
Function ComHeader Returns String
```

The full text of the response header.

### HttpResponse.NumCookies

`Chilkat 11.7.0 · dataflex · HttpResponse · NumCookies · property · read-only`

```dataflex
Function ComNumCookies Returns Integer
```

The number of cookies included in the response.

### HttpResponse.NumHeaderFields

`Chilkat 11.7.0 · dataflex · HttpResponse · NumHeaderFields · property · read-only`

```dataflex
Function ComNumHeaderFields Returns Integer
```

The number of response header fields.

### HttpResponse.StatusCode

`Chilkat 11.7.0 · dataflex · HttpResponse · StatusCode · property · read-only`

```dataflex
Function ComStatusCode Returns Integer
```

The status code (as an integer) from the first line of an HTTP response. If the StatusLine = `HTTP/1.0 200 OK`, the response status code returned is 200.

### HttpResponse.StatusLine

`Chilkat 11.7.0 · dataflex · HttpResponse · StatusLine · property · read-only`

```dataflex
Function ComStatusLine Returns String
```

The first line of an HTTP response, such as `HTTP/1.0 200 OK`.

### HttpResponse.StatusText

`Chilkat 11.7.0 · dataflex · HttpResponse · StatusText · property · read-only · since 9.5.0.49`

```dataflex
Function ComStatusText Returns String
```

The text that follows the status code in the 1st line of the HTTP response. For example, i the first line of an HTTP response is `HTTP/1.0 200 OK`, then this property contains `OK`.

### HttpResponse.UncommonOptions

`Chilkat 11.7.0 · dataflex · HttpResponse · UncommonOptions · property · read/write · since 9.5.0.89`

```dataflex
Function ComUncommonOptions Returns String
Procedure Set ComUncommonOptions String value
```

This is a catch-all property to be used for uncommon needs. Can be set to a list of the following comma separated keywords:

- `TakeResponseBody` - Introduced in v9.5.0.89. The GetBody\* methods will transfer the body to the target object instead of copying the contents. This can be useful if the response body is extremely large because it will reduce the overall memory requirement.

## Methods

### HttpResponse.GetBodyBd

`Chilkat 11.7.0 · dataflex · HttpResponse · GetBodyBd · method · since 9.5.0.64`

```dataflex
Function ComGetBodyBd cComChilkatBinData binData Returns Boolean
```

Copies the response body to a BinData object.

Returns True for success, False for failure.

### HttpResponse.GetBodyJarr

`Chilkat 11.7.0 · dataflex · HttpResponse · GetBodyJarr · method · since 9.5.0.89`

```dataflex
Function ComGetBodyJarr cComChilkatJsonArray jarr Returns Boolean
```

Loads the JSON array response body into a JsonArray This method should only be called when it is known that the response body contains a JSON array (beginning with a square bracket '\[' and ending with a square bracket '\]')

Returns True for success, False for failure.

### HttpResponse.GetBodyJson

`Chilkat 11.7.0 · dataflex · HttpResponse · GetBodyJson · method · since 9.5.0.89`

```dataflex
Function ComGetBodyJson cComChilkatJsonObject json Returns Boolean
```

Loads the JSON response body into a JsonObject. This method should only be called when it is known that the response body contains JSON (beginning with a curly brace '{' and ending with a curly brace '}')

Returns True for success, False for failure.

### HttpResponse.GetBodySb

`Chilkat 11.7.0 · dataflex · HttpResponse · GetBodySb · method · since 9.5.0.64`

```dataflex
Function ComGetBodySb cComChilkatStringBuilder sb Returns Boolean
```

Copies the response body to a Chilkat StringBuilder object.

Returns True for success, False for failure.

### HttpResponse.GetBodyXml

`Chilkat 11.7.0 · dataflex · HttpResponse · GetBodyXml · method · since 9.5.0.89`

```dataflex
Function ComGetBodyXml cComChilkatXml xml Returns Boolean
```

Loads the XML response body into an XML object. This method should only be called when it is known that the response body contains XML.

Returns True for success, False for failure.

### HttpResponse.GetCookieDomain

`Chilkat 11.7.0 · dataflex · HttpResponse · GetCookieDomain · method`

```dataflex
Function ComGetCookieDomain Integer index Returns String
```

Returns the domain of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns `null` on failure

### HttpResponse.GetCookieExpiresStr

`Chilkat 11.7.0 · dataflex · HttpResponse · GetCookieExpiresStr · method`

```dataflex
Function ComGetCookieExpiresStr Integer index Returns String
```

Returns the expiration date/time of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns `null` on failure

### HttpResponse.GetCookieName

`Chilkat 11.7.0 · dataflex · HttpResponse · GetCookieName · method`

```dataflex
Function ComGetCookieName Integer index Returns String
```

Returns the name of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns `null` on failure

### HttpResponse.GetCookiePath

`Chilkat 11.7.0 · dataflex · HttpResponse · GetCookiePath · method`

```dataflex
Function ComGetCookiePath Integer index Returns String
```

Returns the path of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns `null` on failure

### HttpResponse.GetCookieValue

`Chilkat 11.7.0 · dataflex · HttpResponse · GetCookieValue · method`

```dataflex
Function ComGetCookieValue Integer index Returns String
```

Returns the value of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns `null` on failure

### HttpResponse.GetHeaderField

`Chilkat 11.7.0 · dataflex · HttpResponse · GetHeaderField · method`

```dataflex
Function ComGetHeaderField String fieldName Returns String
```

Returns the value of a response header field accessed by field name.

Returns `null` on failure

### HttpResponse.GetHeaderFieldAttr

`Chilkat 11.7.0 · dataflex · HttpResponse · GetHeaderFieldAttr · method`

```dataflex
Function ComGetHeaderFieldAttr String fieldName String attrName Returns String
```

Returns a response header field attribute. As an example, the response charset is simply the GetHeaderFieldAttr(`content-type`,`charset`)

Returns `null` on failure

### HttpResponse.GetHeaderName

`Chilkat 11.7.0 · dataflex · HttpResponse · GetHeaderName · method`

```dataflex
Function ComGetHeaderName Integer index Returns String
```

Gets the name of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property.

Returns `null` on failure

### HttpResponse.GetHeaderValue

`Chilkat 11.7.0 · dataflex · HttpResponse · GetHeaderValue · method`

```dataflex
Function ComGetHeaderValue Integer index Returns String
```

Gets the value of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property.

Returns `null` on failure

### HttpResponse.LoadTaskResult

`Chilkat 11.7.0 · dataflex · HttpResponse · LoadTaskResult · method · since 9.5.0.52`

```dataflex
Function ComLoadTaskResult cComChilkatTask task Returns Boolean
```

Loads the HTTP response from a completed asynchronous task. A failed return value indicates that no HTTP response was received in the HTTP asynchronous method call (i.e. the asynchronous HTTP request failed in such a way that no response was received).

Returns True for success, False for failure.

### HttpResponse.SaveBodyBinary

`Chilkat 11.7.0 · dataflex · HttpResponse · SaveBodyBinary · method`

```dataflex
Function ComSaveBodyBinary String path Returns Boolean
```

Saves the body of the HTTP response to a file.

Returns True for success, False for failure.

### HttpResponse.SaveBodyText

`Chilkat 11.7.0 · dataflex · HttpResponse · SaveBodyText · method`

```dataflex
Function ComSaveBodyText Boolean bCrlf String path Returns Boolean
```

Saves the HTTP response body to a file. This method provides control over CRLF vs bare-LF line-endings. If `bCrlf` is `True`, then line endings are automatically converted to CRLF if necessary. If `bCrlf` is `False`, then line-endings are automatically converted to bare-LF's (Unix style) if necessary.

To save the HTTP response body exactly as-is (with no line-ending manipulation), then call SaveBodyBinary.

Returns True for success, False for failure.

### HttpResponse.UrlEncParamValue

`Chilkat 11.7.0 · dataflex · HttpResponse · UrlEncParamValue · method`

```dataflex
Function ComUrlEncParamValue String encodedParamString String paramName Returns String
```

Convenience method for parsing a param's value out of a URL-encoded param string. For example, if a caller passes the following string in `encodedParamString`:

```
oauth_token=ABC&oauth_token_secret=123&oauth_callback_confirmed=true
```

and `oauth_token_secret` in `paramName`, then the return value would be `123`.

Returns `null` on failure

## Related classes

[`BinData`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/dataflex/classes/BinData.md), [`JsonArray`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/dataflex/classes/JsonArray.md), [`JsonObject`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/dataflex/classes/JsonObject.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/dataflex/classes/StringBuilder.md), [`Task`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/dataflex/classes/Task.md), [`Xml`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/dataflex/classes/Xml.md)

