serverctl/scripts/scratch.http

48 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2022-02-16 15:30:38 +01:00
POST http://localhost:8080/auth/register
Content-Type: application/json
{
"email": "some-user-email@gmail.com",
"password": "some-password"
}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 201, "response status is not 200")
})
client.test("Response content-type is json", function() {
const type = response.contentType.mimeType;
client.assert(type === "application/json", "Expected 'application/json' but received '" + type + "'");
});
%}
###
POST http://localhost:8080/projects/
Content-Type: application/json
Authorization: Basic some-user-email@gmail.com some-password
{
"name": "some-project-name"
}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 201, "response status is not 200")
})
client.test("Response content-type is json", function() {
var type = response.contentType.mimeType;
client.assert(type === "application/json", "Expected 'application/json' but received '" + type + "'");
});
%}
###
POST http://localhost:8080/applications/
Content-Type: application/json
Authorization: Basic some-user-email@gmail.com some-password
{
"projectId": 1,
"name": "some-application-name"
}