| // Copyright 2015 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef LIBWEAVE_INCLUDE_WEAVE_PROVIDER_HTTP_CLIENT_H_ |
| #define LIBWEAVE_INCLUDE_WEAVE_PROVIDER_HTTP_CLIENT_H_ |
| #include <base/callback.h> |
| virtual int GetStatusCode() const = 0; |
| virtual std::string GetContentType() const = 0; |
| virtual std::string GetData() const = 0; |
| virtual ~Response() = default; |
| using Headers = std::vector<std::pair<std::string, std::string>>; |
| using SuccessCallback = base::Callback<void(const Response&)>; |
| virtual void SendRequest(Method method, |
| const SuccessCallback& success_callback, |
| const ErrorCallback& error_callback) = 0; |
| virtual ~HttpClient() = default; |
| #endif // LIBWEAVE_INCLUDE_WEAVE_PROVIDER_HTTP_CLIENT_H_ |