Link Search Menu Expand Document

Interactions for working with REST APIs

Delete

Delete from the specified resource.

Ability

Methods

name parameter description
.from()* request: SppRequest the request to send for the DELETE method
.continueOnError() - dont exit in case of an error, html codes 4xx and 5xx are considered an error

Example

create a request. In general the resource is parameterized e.g. a userId, for simplicity a plain simple resource is used.

const user = request(On.resource("htpps://example.com/user/"));

const response = await john.attemptsTo(
    Delete.from(user)
)
const response = await Delete.from(user).performAs(john)

Get

Get the resource.

Ability

Methods

name parameter description
.from()* request: SppRequest the request to send for the GET method
.continueOnError() - dont exit in case of an error, html codes 4xx and 5xx are considered an error

Example

const response = await john.attemptsTo(
    Get.from(user)
)
const response = await Get.from(user).performAs(john)

Post

Ability

Methods

Example