MCPcopy Create free account
hub / github.com/comaps/comaps / DirectRequest

Method DirectRequest

libs/editor/osm_auth.cpp:385–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385OsmOAuth::Response OsmOAuth::DirectRequest(string const & method, bool api) const
386{
387 string const url = api ? m_apiUrl + kApiVersion + method : m_baseUrl + method;
388 HttpClient request(url);
389 if (!request.RunHttpRequest())
390 MYTHROW(NetworkError, ("DirectRequest Network error while connecting to", url));
391 if (request.WasRedirected())
392 MYTHROW(UnexpectedRedirect, ("Redirected to", request.UrlReceived(), "from", url));
393
394 return {request.ErrorCode(), request.ServerResponse()};
395}
396
397string DebugPrint(OsmOAuth::Response const & code)
398{

Callers 2

TestOSMUserMethod · 0.80
GetXmlFeaturesInRectMethod · 0.80

Calls 3

WasRedirectedMethod · 0.80
ErrorCodeMethod · 0.80
RunHttpRequestMethod · 0.45

Tested by 1

TestOSMUserMethod · 0.64