---
product: Chilkat
product_version: 11.7.0
language: asp
language_label: Classic ASP
class: HttpResponse
license: bundle
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/asp_HttpResponseRef.html
---
# Chilkat HttpResponse — Classic ASP — v11.7.0

> Chilkat 11.7.0 · language=asp · 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/asp/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**

```visual-basic
set httpResponse = Server.CreateObject("Chilkat.HttpResponse")

' ... use httpResponse ...

set httpResponse = Nothing
```

Classic ASP creates Chilkat objects with `Server.CreateObject`. The registered Chilkat ActiveX must match the bitness of the IIS application pool: a pool with *Enable 32-Bit Applications* set to True needs the 32-bit ActiveX, otherwise the 64-bit ActiveX. To bind to a specific major version of Chilkat, append the major version number to the ProgID, such as `Server.CreateObject("Chilkat.HttpResponse.11")` for Chilkat v11.\*.\*.

VBScript requires `set` when assigning an object, so the signatures on this page show `set x = obj.Method(...)` for methods that return a Chilkat object; test the result with `Is Nothing`, since a method that fails to return an object returns `Nothing`. A method with no return value is called as a statement without parentheses (`obj.Method arg1, arg2`). Boolean properties, arguments and return values are integers in the ActiveX: pass `1` or `0`, and test success with `= 1`. Byte arrays are Variant arrays and can be sent with `Response.BinaryWrite`. Asynchronous (*\*Async*) methods and event callbacks are not used from Classic ASP.

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 Classic ASP.

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` | `httpResponse.DebugLogFilePath ' String` | 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` | `httpResponse.LastBinaryResult ' Variant (read-only)` | 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` | `httpResponse.LastErrorHtml ' String (read-only)` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `httpResponse.LastErrorText ' String (read-only)` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `httpResponse.LastErrorXml ' String (read-only)` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `httpResponse.LastMethodSuccess ' Long` | read/write | Indicates the success or failure of the most recent method call: `1` means success, `0` means failure. |
| `LastStringResult` | `httpResponse.LastStringResult ' String (read-only)` | 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` | `httpResponse.LastStringResultLen ' Long (read-only)` | read-only | The length, in characters, of the string contained in the LastStringResult property. |
| `VerboseLogging` | `httpResponse.VerboseLogging ' Long` | read/write | If set to `1`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `httpResponse.Version ' String (read-only)` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `Body` | property, read-only | `httpResponse.Body ' Variant (read-only)` |
| `BodyQP` | property, read-only | `httpResponse.BodyQP ' String (read-only)` |
| `BodyStr` | property, read-only | `httpResponse.BodyStr ' String (read-only)` |
| `Charset` | property, read-only | `httpResponse.Charset ' String (read-only)` |
| `ContentLength` | property, read-only | `httpResponse.ContentLength ' Long (read-only)` |
| `DateStr` | property, read-only | `httpResponse.DateStr ' String (read-only)` |
| `Domain` | property, read-only | `httpResponse.Domain ' String (read-only)` |
| `FinalRedirectUrl` | property, read-only | `httpResponse.FinalRedirectUrl ' String (read-only)` |
| `FullMime` | property, read-only | `httpResponse.FullMime ' String (read-only)` |
| `Header` | property, read-only | `httpResponse.Header ' String (read-only)` |
| `NumCookies` | property, read-only | `httpResponse.NumCookies ' Long (read-only)` |
| `NumHeaderFields` | property, read-only | `httpResponse.NumHeaderFields ' Long (read-only)` |
| `StatusCode` | property, read-only | `httpResponse.StatusCode ' Long (read-only)` |
| `StatusLine` | property, read-only | `httpResponse.StatusLine ' String (read-only)` |
| `StatusText` | property, read-only | `httpResponse.StatusText ' String (read-only)` |
| `UncommonOptions` | property, read/write | `httpResponse.UncommonOptions ' String` |
| `GetBodyBd` | method | `success = httpResponse.GetBodyBd(binData) ' Long (1/0)` |
| `GetBodyJarr` | method | `success = httpResponse.GetBodyJarr(jarr) ' Long (1/0)` |
| `GetBodyJson` | method | `success = httpResponse.GetBodyJson(json) ' Long (1/0)` |
| `GetBodySb` | method | `success = httpResponse.GetBodySb(sb) ' Long (1/0)` |
| `GetBodyXml` | method | `success = httpResponse.GetBodyXml(xml) ' Long (1/0)` |
| `GetCookieDomain` | method | `str = httpResponse.GetCookieDomain(index) ' String` |
| `GetCookieExpiresStr` | method | `str = httpResponse.GetCookieExpiresStr(index) ' String` |
| `GetCookieName` | method | `str = httpResponse.GetCookieName(index) ' String` |
| `GetCookiePath` | method | `str = httpResponse.GetCookiePath(index) ' String` |
| `GetCookieValue` | method | `str = httpResponse.GetCookieValue(index) ' String` |
| `GetHeaderField` | method | `str = httpResponse.GetHeaderField(fieldName) ' String` |
| `GetHeaderFieldAttr` | method | `str = httpResponse.GetHeaderFieldAttr(fieldName, attrName) ' String` |
| `GetHeaderName` | method | `str = httpResponse.GetHeaderName(index) ' String` |
| `GetHeaderValue` | method | `str = httpResponse.GetHeaderValue(index) ' String` |
| `SaveBodyBinary` | method | `success = httpResponse.SaveBodyBinary(path) ' Long (1/0)` |
| `SaveBodyText` | method | `success = httpResponse.SaveBodyText(bCrlf, path) ' Long (1/0)` |
| `UrlEncParamValue` | method | `str = httpResponse.UrlEncParamValue(encodedParamString, paramName) ' String` |

## Properties

### HttpResponse.Body

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

```visual-basic
httpResponse.Body  ' Variant (read-only)
```

The response body returned as a byte array.

### HttpResponse.BodyQP

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

```visual-basic
httpResponse.BodyQP  ' String (read-only)
```

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

### HttpResponse.BodyStr

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

```visual-basic
httpResponse.BodyStr  ' String (read-only)
```

The response body returned as a string.

### HttpResponse.Charset

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

```visual-basic
httpResponse.Charset  ' String (read-only)
```

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 · asp · HttpResponse · ContentLength · property · read-only`

```visual-basic
httpResponse.ContentLength  ' Long (read-only)
```

The content length of the response, in bytes.

### HttpResponse.DateStr

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

```visual-basic
httpResponse.DateStr  ' String (read-only)
```

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

### HttpResponse.Domain

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

```visual-basic
httpResponse.Domain  ' String (read-only)
```

The domain of the HTTP server that created this response.

### HttpResponse.FinalRedirectUrl

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

```visual-basic
httpResponse.FinalRedirectUrl  ' String (read-only)
```

Returns the redirect URL for 301/302 responses.

### HttpResponse.FullMime

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

```visual-basic
httpResponse.FullMime  ' String (read-only)
```

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

### HttpResponse.Header

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

```visual-basic
httpResponse.Header  ' String (read-only)
```

The full text of the response header.

### HttpResponse.NumCookies

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

```visual-basic
httpResponse.NumCookies  ' Long (read-only)
```

The number of cookies included in the response.

### HttpResponse.NumHeaderFields

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

```visual-basic
httpResponse.NumHeaderFields  ' Long (read-only)
```

The number of response header fields.

### HttpResponse.StatusCode

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

```visual-basic
httpResponse.StatusCode  ' Long (read-only)
```

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 · asp · HttpResponse · StatusLine · property · read-only`

```visual-basic
httpResponse.StatusLine  ' String (read-only)
```

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

### HttpResponse.StatusText

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

```visual-basic
httpResponse.StatusText  ' String (read-only)
```

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 · asp · HttpResponse · UncommonOptions · property · read/write · since 9.5.0.89`

```visual-basic
httpResponse.UncommonOptions  ' String
```

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 · asp · HttpResponse · GetBodyBd · method · since 9.5.0.64`

```visual-basic
success = httpResponse.GetBodyBd(binData)  ' Long (1/0)
```

Copies the response body to a BinData object.

Returns 1 for success, 0 for failure.

### HttpResponse.GetBodyJarr

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

```visual-basic
success = httpResponse.GetBodyJarr(jarr)  ' Long (1/0)
```

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 1 for success, 0 for failure.

### HttpResponse.GetBodyJson

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

```visual-basic
success = httpResponse.GetBodyJson(json)  ' Long (1/0)
```

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 1 for success, 0 for failure.

### HttpResponse.GetBodySb

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

```visual-basic
success = httpResponse.GetBodySb(sb)  ' Long (1/0)
```

Copies the response body to a Chilkat StringBuilder object.

Returns 1 for success, 0 for failure.

### HttpResponse.GetBodyXml

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

```visual-basic
success = httpResponse.GetBodyXml(xml)  ' Long (1/0)
```

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 1 for success, 0 for failure.

### HttpResponse.GetCookieDomain

`Chilkat 11.7.0 · asp · HttpResponse · GetCookieDomain · method`

```visual-basic
str = httpResponse.GetCookieDomain(index)  ' 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 `Nothing` on failure

### HttpResponse.GetCookieExpiresStr

`Chilkat 11.7.0 · asp · HttpResponse · GetCookieExpiresStr · method`

```visual-basic
str = httpResponse.GetCookieExpiresStr(index)  ' 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 `Nothing` on failure

### HttpResponse.GetCookieName

`Chilkat 11.7.0 · asp · HttpResponse · GetCookieName · method`

```visual-basic
str = httpResponse.GetCookieName(index)  ' 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 `Nothing` on failure

### HttpResponse.GetCookiePath

`Chilkat 11.7.0 · asp · HttpResponse · GetCookiePath · method`

```visual-basic
str = httpResponse.GetCookiePath(index)  ' 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 `Nothing` on failure

### HttpResponse.GetCookieValue

`Chilkat 11.7.0 · asp · HttpResponse · GetCookieValue · method`

```visual-basic
str = httpResponse.GetCookieValue(index)  ' 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 `Nothing` on failure

### HttpResponse.GetHeaderField

`Chilkat 11.7.0 · asp · HttpResponse · GetHeaderField · method`

```visual-basic
str = httpResponse.GetHeaderField(fieldName)  ' String
```

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

Returns `Nothing` on failure

### HttpResponse.GetHeaderFieldAttr

`Chilkat 11.7.0 · asp · HttpResponse · GetHeaderFieldAttr · method`

```visual-basic
str = httpResponse.GetHeaderFieldAttr(fieldName, attrName)  ' String
```

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

Returns `Nothing` on failure

### HttpResponse.GetHeaderName

`Chilkat 11.7.0 · asp · HttpResponse · GetHeaderName · method`

```visual-basic
str = httpResponse.GetHeaderName(index)  ' 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 `Nothing` on failure

### HttpResponse.GetHeaderValue

`Chilkat 11.7.0 · asp · HttpResponse · GetHeaderValue · method`

```visual-basic
str = httpResponse.GetHeaderValue(index)  ' 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 `Nothing` on failure

### HttpResponse.SaveBodyBinary

`Chilkat 11.7.0 · asp · HttpResponse · SaveBodyBinary · method`

```visual-basic
success = httpResponse.SaveBodyBinary(path)  ' Long (1/0)
```

Saves the body of the HTTP response to a file.

Returns 1 for success, 0 for failure.

### HttpResponse.SaveBodyText

`Chilkat 11.7.0 · asp · HttpResponse · SaveBodyText · method`

```visual-basic
success = httpResponse.SaveBodyText(bCrlf, path)  ' Long (1/0)
```

Saves the HTTP response body to a file. This method provides control over CRLF vs bare-LF line-endings. If `bCrlf` is `1`, then line endings are automatically converted to CRLF if necessary. If `bCrlf` is `0`, 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 1 for success, 0 for failure.

### HttpResponse.UrlEncParamValue

`Chilkat 11.7.0 · asp · HttpResponse · UrlEncParamValue · method`

```visual-basic
str = httpResponse.UrlEncParamValue(encodedParamString, paramName)  ' 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 `Nothing` on failure

## Related classes

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

