Mercurial > hg > orthanc
comparison Core/HttpClient.h @ 1606:31f4adefb88f
issuing HTTP requests from the plugin SDK
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 01 Sep 2015 17:37:26 +0200 |
parents | ba0226474e22 |
children | b1291df2f780 |
comparison
equal
deleted
inserted
replaced
1605:fd0464ce1962 | 1606:31f4adefb88f |
---|---|
48 | 48 |
49 std::string url_; | 49 std::string url_; |
50 std::string credentials_; | 50 std::string credentials_; |
51 HttpMethod method_; | 51 HttpMethod method_; |
52 HttpStatus lastStatus_; | 52 HttpStatus lastStatus_; |
53 std::string postData_; | 53 std::string body_; // This only makes sense for POST and PUT requests |
54 bool isVerbose_; | 54 bool isVerbose_; |
55 long timeout_; | 55 long timeout_; |
56 std::string proxy_; | 56 std::string proxy_; |
57 bool verifyPeers_; | 57 bool verifyPeers_; |
58 std::string caCertificates_; | 58 std::string caCertificates_; |
101 long GetTimeout() const | 101 long GetTimeout() const |
102 { | 102 { |
103 return timeout_; | 103 return timeout_; |
104 } | 104 } |
105 | 105 |
106 void SetPostData(const std::string& data) | 106 void SetBody(const std::string& data) |
107 { | 107 { |
108 postData_ = data; | 108 body_ = data; |
109 } | 109 } |
110 | 110 |
111 std::string& AccessPostData() | 111 std::string& GetBody() |
112 { | 112 { |
113 return postData_; | 113 return body_; |
114 } | 114 } |
115 | 115 |
116 const std::string& AccessPostData() const | 116 const std::string& GetBody() const |
117 { | 117 { |
118 return postData_; | 118 return body_; |
119 } | 119 } |
120 | 120 |
121 void SetVerbose(bool isVerbose); | 121 void SetVerbose(bool isVerbose); |
122 | 122 |
123 bool IsVerbose() const | 123 bool IsVerbose() const |
163 const std::string& httpsCACertificates); | 163 const std::string& httpsCACertificates); |
164 | 164 |
165 static void GlobalFinalize(); | 165 static void GlobalFinalize(); |
166 | 166 |
167 static void SetDefaultTimeout(long timeout); | 167 static void SetDefaultTimeout(long timeout); |
168 | |
169 void ApplyAndThrowException(std::string& answer); | |
170 | |
171 void ApplyAndThrowException(Json::Value& answer); | |
168 }; | 172 }; |
169 } | 173 } |