Lines Matching refs:http
11 #include <brillo/http/http_transport_fake.h>
12 #include <brillo/http/http_utils.h>
19 namespace http {
21 static const char kFakeUrl[] = "http://localhost";
22 static const char kEchoUrl[] = "http://localhost/echo";
23 static const char kMethodEchoUrl[] = "http://localhost/echo/method";
50 http::SendRequestAndBlock(request_type::kPost,
73 std::unique_ptr<http::Response> response) {
82 http::SendRequest(request_type::kPost,
100 // Check the correct HTTP method used.
102 http::SendRequestAndBlock(request_type::kPost,
119 auto response = http::SendRequestAndBlock(request_type::kGet,
136 auto response = http::SendRequestAndBlock(request_type::kPut,
152 auto response = http::SendRequestWithNoDataAndBlock(
153 request_type::kGet, "http://blah.com", {}, transport, nullptr);
162 [](RequestID /* request_id */, std::unique_ptr<http::Response> response) {
170 http::SendRequestWithNoData(request_type::kGet,
171 "http://blah.com",
181 static const char json_echo_url[] = "http://localhost/echo/json";
193 auto response = http::SendRequestAndBlock(
220 // So if we do GET "http://localhost?test=blah", this handler responds
237 auto response = http::GetAndBlock(kMethodEchoUrl, {}, transport, nullptr);
244 response = http::GetAndBlock(url, {}, transport, nullptr);
261 auto response = http::HeadAndBlock(kFakeUrl, transport, nullptr);
291 auto response = http::PostBinaryAndBlock(kFakeUrl,
320 auto response = http::PostTextAndBlock(kFakeUrl,
336 auto response = http::PostFormDataAndBlock(
356 auto response = http::PostFormDataAndBlock(
395 http::PostJsonAndBlock(kFakeUrl, &json, {}, transport, nullptr);
396 auto resp_json = http::ParseJsonResponse(response.get(), nullptr, nullptr);
404 response = http::PatchJsonAndBlock(kFakeUrl, &json, {}, transport, nullptr);
405 resp_json = http::ParseJsonResponse(response.get(), nullptr, nullptr);
425 auto response = http::PostFormDataAndBlock(
431 auto json = http::ParseJsonResponse(response.get(), &code, nullptr);
440 auto response = http::GetAndBlock("http://bad.url", {}, transport, nullptr);
444 auto json = http::ParseJsonResponse(response.get(), &code, nullptr);
456 auto response = http::SendRequestWithNoDataAndBlock(
457 request_type::kGet, "http://blah.com", {}, transport, &error);
472 std::unique_ptr<http::Response> /* response */) {
480 http::SendRequestWithNoData(request_type::kGet,
481 "http://blah.com",
501 } // namespace http