# OAuthResponse

## Overview

The `OAuthResponse` class is used to handle HTTP responses in the context of OAuth-based API interactions. It provides mechanisms to retrieve the HTTP status code, individual header values, and all header names associated with the response.

Key functionalities include the ability to fetch the HTTP status code through `getCode()`, retrieve a specific header value using `getHeader(name)`, and obtain a list of all headers with `getHeaders()`.

## Methods Summarized

| Type                                                     | Name                               | Summary |
| -------------------------------------------------------- | ---------------------------------- | ------- |
| [Number](/reference/servoycore/dev-api/js-lib/number.md) | [getCode()](#getcode)              |         |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [getHeader(name)](#getheader-name) |         |
| [Array](/reference/servoycore/dev-api/js-lib/array.md)   | [getHeaders()](#getheaders)        |         |

## Methods Detailed

### getCode()

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The HTTP status code of the OAuth response.

### getHeader(name)

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **name** ;

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) The value of the specified header, or null if the header is not present.

### getHeaders()

**Returns:** [Array](/reference/servoycore/dev-api/js-lib/array.md) An array of all header names in the OAuth response.

***


---

# 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.servoy.com/reference/servoyextensions/server-plugins/oauth/oauthresponse.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.
