MTXClient: Add support for logging out
FossilOrigin-Name: c29845b7b81229ea7bf062304824a4087c160629216064ae1a647fe8286826bb
This commit is contained in:
parent
023ed62f5a
commit
77a2d20fc7
11 changed files with 209 additions and 25 deletions
|
@ -101,8 +101,8 @@
|
|||
OFMutableDictionary *headers = [OFMutableDictionary dictionary];
|
||||
headers[@"User-Agent"] = @"ObjMatrix";
|
||||
if (_accessToken != nil)
|
||||
headers[@"Authentication"] = [OFString
|
||||
stringWithFormat: @"Bearer %@", _accessToken];
|
||||
headers[@"Authorization"] =
|
||||
[OFString stringWithFormat: @"Bearer %@", _accessToken];
|
||||
if (_body != nil)
|
||||
headers[@"Content-Length"] = @(_body.count).stringValue;
|
||||
|
||||
|
@ -139,9 +139,9 @@
|
|||
count: length];
|
||||
}
|
||||
|
||||
OFDictionary<OFString *, id> *responseJSON =
|
||||
[OFString stringWithUTF8String: responseData.items
|
||||
length: responseData.count]
|
||||
mtx_response_t responseJSON = [OFString
|
||||
stringWithUTF8String: responseData.items
|
||||
length: responseData.count]
|
||||
.objectByParsingJSON;
|
||||
|
||||
block(responseJSON, response.statusCode, nil);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue