# OAuthResponseBinary

## Overview

The `OAuthResponseBinary` object is used to handle binary responses during OAuth authentication. It allows developers to retrieve important information such as the HTTP response code, specific header values, or all headers in the response. This makes it easier to process and analyze responses from the OAuth service.

The `getCode()` method provides the HTTP response code as a number, enabling developers to determine the success or failure of a request. The `getHeader(name)` method retrieves the value of a specific header when given its name, returning the result as a string. For a comprehensive view of the response headers, the `getHeaders()` method returns all headers in an array format.

For more information about authentication using the OAuth service, refer to the [Oauth Provider](https://docs.servoy.com/guides/develop/security/authentication#oauth-provider) from the [Authentication](https://docs.servoy.com/guides/develop/security/authentication) section of this documentation.

## Methods Summarized

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

## Methods Detailed

### getCode()

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

### getHeader(name)

**Parameters**

* [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string) **name** ;

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

### getHeaders()

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

***
