---
title: "Ajax | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/Ajax/"
---

# Ajax

> - [ContentType](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/Ajax.Namespace.ContentType.md)
> - [RequestType](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/Ajax.Namespace.RequestType.md)

## Namespaces

## Enumerations

### StatusCode

#### Enumeration Members

| Enumeration Member | Value |
| ------ | ------ |
|  `InternalServerError` | `500` |
|  `NoContent` | `204` |
|  `NotFound` | `404` |
|  `Ok` | `200` |

## Classes

### Exception

#### Constructors

##### Constructor

```ts
new Exception(response): Exception;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `response` | [`IResponse`](#iresponse) |

###### Returns

[`Exception`](#exception)

#### Properties

##### response

```ts
response: IResponse;
```

## Interfaces

### IRequestParameters

#### Properties

##### data?

```ts
optional data?: string;
```

##### headers?

```ts
optional headers?: object[];
```

###### name

```ts
name: string;
```

###### value

```ts
value: string;
```

##### responseType?

```ts
optional responseType?: XMLHttpRequestResponseType;
```

##### type

```ts
type: string;
```

##### url

```ts
url: string;
```

***

### IResponse

#### Properties

##### contentType

```ts
contentType: string;
```

##### status

```ts
status: number;
```

##### value

```ts
value: string;
```

##### xhr

```ts
xhr: XMLHttpRequest;
```

## Variables

### request

```ts
const request: (parameters) => Promise<IResponse>;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `parameters` | [`IRequestParameters`](#irequestparameters) |

#### Returns

[`Promise`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/finally.md#promise)\<[`IResponse`](#iresponse)\>

## Functions

### getJson()

```ts
function getJson(url): Promise<IResponse>;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `url` | `string` |

#### Returns

[`Promise`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/finally.md#promise)\<[`IResponse`](#iresponse)\>

***

### postJson()

```ts
function postJson(url, data): Promise<IResponse>;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `url` | `string` |
| `data` | `string` |

#### Returns

[`Promise`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms/finally.md#promise)\<[`IResponse`](#iresponse)\>
