Lines Matching refs:json
181 static const char json_echo_url[] = "http://localhost/echo/json";
184 base::DictionaryValue json;
185 json.SetString("method", request.GetMethod());
186 json.SetString("data", request.GetDataAsString());
188 json.SetString("header." + pair.first, pair.second);
190 response->ReplyJson(status_code::Ok, &json);
202 auto json = ParseJsonResponse(response.get(), nullptr, nullptr);
204 EXPECT_TRUE(json->GetString("method", &value));
206 EXPECT_TRUE(json->GetString("data", &value));
208 EXPECT_TRUE(json->GetString("header.Cookie", &value));
210 EXPECT_TRUE(json->GetString("header.Content-Type", &value));
212 EXPECT_TRUE(json->GetString("header.Content-Length", &value));
214 EXPECT_TRUE(json->GetString("header.If-Match", &value));
386 base::DictionaryValue json;
387 json.SetString("key1", "val1");
388 json.SetString("key2", "val2");
393 http::PostJsonAndBlock(kFakeUrl, &json
402 response = http::PatchJsonAndBlock(kFakeUrl, &json, {}, transport, nullptr);
420 // Test valid JSON responses (with success or error codes).
429 auto json = http::ParseJsonResponse(response.get(), &code, nullptr);
430 EXPECT_NE(nullptr, json.get());
432 EXPECT_TRUE(json->GetString("data", &value));
437 // Test invalid (non-JSON) response.
442 auto json = http::ParseJsonResponse(response.get(), &code, nullptr);
443 EXPECT_EQ(nullptr, json.get());