MCPcopy Create free account
hub / github.com/The-Powder-Toy/The-Powder-Toy / APIRequest

Method APIRequest

src/client/http/APIRequest.cpp:18–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 }
17
18 APIRequest::APIRequest(format::Url url, AuthMode authMode, bool newCheckStatus) : Request(MaybeAppendSession(authMode, url).ToByteString()), checkStatus(newCheckStatus)
19 {
20 auto user = Client::Ref().GetAuthUser();
21 if ((authMode == authRequire ||
22 authMode == authRequireAppendSession) && !user)
23 {
24 FailEarly("Not authenticated");
25 return;
26 }
27 if (authMode != authOmit && user)
28 {
29 AuthHeaders(ByteString::Build(user->UserID), user->SessionID);
30 }
31 }
32
33 Json::Value APIRequest::Finish()
34 {

Callers

nothing calls this directly

Calls 1

ToByteStringMethod · 0.80

Tested by

no test coverage detected