Files
archived-tauri-docs/docs/api/js/classes/http.Body.md
2022-03-29 07:36:52 +02:00

2.2 KiB

@tauri-apps/api / http / Body

Class: Body

http.Body

The body object to be used on POST and PUT requests.

Properties

payload

payload: unknown

Defined in

http.ts:64


type

type: string

Defined in

http.ts:63

Methods

bytes

Static bytes(bytes): Body

Creates a new byte array body.

Parameters

Name Type
bytes Uint8Array

Returns

Body

The body object ready to be used on the POST and PUT requests.

Defined in

http.ts:119


form

Static form(data): Body

Creates a new form data body.

Parameters

Name Type Description
data Record<string, Part> The body data.

Returns

Body

The body object ready to be used on the POST and PUT requests.

Defined in

http.ts:79


json

Static json(data): Body

Creates a new JSON body.

Parameters

Name Type Description
data Record<any, any> The body JSON object.

Returns

Body

The body object ready to be used on the POST and PUT requests.

Defined in

http.ts:97


text

Static text(value): Body

Creates a new UTF-8 string body.

Parameters

Name Type
value string

Returns

Body

The body object ready to be used on the POST and PUT requests.

Defined in

http.ts:108