зеркало из https://github.com/microsoft/winsdkfb.git
reworked graph uri query string param generation
This commit is contained in:
Родитель
ca479109f8
Коммит
8b7fa51b37
|
@ -73,17 +73,17 @@ Windows::Foundation::Uri^ GraphUriBuilder::MakeUri()
|
|||
_host = static_cast<String^>(_queryParams->Lookup(L"request_host"));
|
||||
}
|
||||
String^ fullPath = _scheme + L"://" + _host + L"/" + _apiVersion + _path;
|
||||
|
||||
if (_queryParams->Size > 0)
|
||||
{
|
||||
fullPath += L"?";
|
||||
while (_queryParams->Size > 1)
|
||||
String^ separator = L"?";
|
||||
auto it = _queryParams->First();
|
||||
while (it->HasCurrent)
|
||||
{
|
||||
auto it = _queryParams->First();
|
||||
fullPath += Uri::EscapeComponent(it->Current->Key) + L"=" + Uri::EscapeComponent(static_cast<String^>(it->Current->Value)) + L"&";
|
||||
_queryParams->Remove(it->Current->Key);
|
||||
fullPath += separator + Uri::EscapeComponent(it->Current->Key) + L"=" + Uri::EscapeComponent(static_cast<String^>(it->Current->Value));
|
||||
separator = L"&";
|
||||
it->MoveNext();
|
||||
}
|
||||
auto it = _queryParams->First();
|
||||
fullPath += Uri::EscapeComponent(it->Current->Key) + L"=" + Uri::EscapeComponent(static_cast<String^>(it->Current->Value));
|
||||
}
|
||||
return ref new Uri(fullPath);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче