HttpRequest.cc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright 1999-2019 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <alibabacloud/core/AlibabaCloud.h>
  17. #include <alibabacloud/core/HttpRequest.h>
  18. namespace AlibabaCloud {
  19. HttpRequest::HttpRequest(const Url &url, Method method)
  20. : HttpMessage(), url_(url), method_(method),
  21. connectTimeout_(kDefaultConnectTimeout),
  22. readTimeout_(kDefaultReadTimeout) {}
  23. HttpRequest::~HttpRequest() {}
  24. HttpRequest::Method HttpRequest::method() const { return method_; }
  25. void HttpRequest::setMethod(Method method) { method_ = method; }
  26. void HttpRequest::setUrl(const Url &url) { url_ = url; }
  27. Url HttpRequest::url() const { return url_; }
  28. long HttpRequest::connectTimeout() const { return connectTimeout_; }
  29. long HttpRequest::readTimeout() const { return readTimeout_; }
  30. void HttpRequest::setConnectTimeout(const long connectTimeout) {
  31. connectTimeout_ = connectTimeout;
  32. }
  33. void HttpRequest::setReadTimeout(const long readTimeout) {
  34. readTimeout_ = readTimeout;
  35. }
  36. } // namespace AlibabaCloud