RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
HttpHelper.h
1 /*
2  * ======================================================================
3  * Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
4  * Licensed under the MIT License.
5  * See LICENSE.md in the project root for license information.
6  * ======================================================================
7 */
8 
9 #ifndef HTTPHELPER_H
10 #define HTTPHELPER_H
11 
12 #include "types.h"
13 #include "RequestParameters.h"
14 #include "CallState.h"
15 #include "Entities.h"
16 #include "rmsauthExport.h"
17 
18 namespace rmsauth {
19 
20 class RMSAUTH_EXPORT HttpHelper
21 {
22  static const String& Tag() {static const String tag="HttpHelperQt"; return tag;}
23 
24 public:
25  static TokenResponsePtr sendPostRequestAndDeserializeJsonResponseAsync(const String& uri, const RequestParameters& requestParameters, const CallStatePtr callState);
26  // to use trusted CA put certificates
27  static bool addCACertificateBase64(const std::vector<uint8_t> &certificate);
28  static bool addCACertificateDer(const std::vector<uint8_t> &certificate);
29 
30  enum class StatusCode
31  {
32  Continue = 100,
33  SwitchingProtocols = 101,
34  OK = 200,
35  Created = 201,
36  Accepted = 202,
37  NonAuthoritativeInformation = 203,
38  NoContent = 204,
39  ResetContent = 205,
40  PartialContent = 206,
41  MultipleChoices = 300,
42  Ambiguous = 300,
43  MovedPermanently = 301,
44  Moved = 301,
45  Found = 302,
46  Redirect = 302,
47  SeeOther = 303,
48  RedirectMethod = 303,
49  NotModified = 304,
50  UseProxy = 305,
51  Unused = 306,
52  RedirectKeepVerb = 307,
53  TemporaryRedirect = 307,
54  BadRequest = 400,
55  Unauthorized = 401,
56  PaymentRequired = 402,
57  Forbidden = 403,
58  NotFound = 404,
59  MethodNotAllowed = 405,
60  NotAcceptable = 406,
61  ProxyAuthenticationRequired = 407,
62  RequestTimeout = 408,
63  Conflict = 409,
64  Gone = 410,
65  LengthRequired = 411,
66  PreconditionFailed = 412,
67  RequestEntityTooLarge = 413,
68  RequestUriTooLong = 414,
69  UnsupportedMediaType = 415,
70  RequestedRangeNotSatisfiable = 416,
71  ExpectationFailed = 417,
72  UpgradeRequired = 426,
73  InternalServerError = 500,
74  NotImplemented = 501,
75  BadGateway = 502,
76  ServiceUnavailable = 503,
77  GatewayTimeout = 504,
78  HttpVersionNotSupported = 505,
79  };
80 };
81 
82 } // namespace rmsauth {
83 
84 #endif // HTTPHELPER_H
Definition: RequestParameters.h:18
Definition: HttpHelper.h:20
Definition: AcquireTokenForClientHandler.h:14