I’m using the following to logout a session-token from a WriteFreely instance. The session-token is obtained in the beginning of the script and stored in the variable token
. server
is a constant containing the servername, with the WriteFreely instance.
The logout is according to the WriteFreely API supposed to return a statuscode 204. Which it does. However this generates an warning in the Action Log:
HTTP.request Failed: 204, Unknown error
server LOGOUT FINE response code: 204
server LOGOUT FINE text:
Script step completed.
Having read into the reference documentation on HTTP and HTTPResponse I see no reason why it results in the warning, nor how I can suppress it.
This is the code which is used for the logout-part:
var http_logout = HTTP.create();
var http_logout_response = http_logout.request({
"url": "https://" + server + "/api/auth/me",
"method": "DELETE",
"headers": {
"Authorization": token,
}
});
if (http_logout_response.statusCode != 204) {
console.log(server + " LOGOUT ERROR response code: " + http_logout_response.statusCode);
console.log(server + " LOGOUT ERROR text: " + http_logout_response.responseText);
context.fail();
} else {
console.log(server + " LOGOUT FINE response code: " + http_logout_response.statusCode);
console.log(server + " LOGOUT FINE text: " + http_logout_response.responseText);
}
Is there something I’m missing, or is it just the way things are?