AWS SDK for C++
0.14.3
AWS SDK for C++
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
aws-cpp-sdk-core
include
aws
core
http
curl
CurlHttpClient.h
Go to the documentation of this file.
1
/*
2
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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
* A copy of the License is located at
7
*
8
* http://aws.amazon.com/apache2.0
9
*
10
* or in the "license" file accompanying this file. This file is distributed
11
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12
* express or implied. See the License for the specific language governing
13
* permissions and limitations under the License.
14
*/
15
16
17
#pragma once
18
19
#include <
aws/core/Core_EXPORTS.h
>
20
#include <
aws/core/http/HttpClient.h
>
21
#include <
aws/core/http/curl/CurlHandleContainer.h
>
22
#include <
aws/core/client/ClientConfiguration.h
>
23
#include <
aws/core/utils/memory/stl/AWSString.h
>
24
#include <atomic>
25
26
namespace
Aws
27
{
28
namespace
Http
29
{
30
31
32
//Curl implementation of an http client. Right now it is only synchronous.
33
class
AWS_CORE_API
CurlHttpClient
:
public
HttpClient
34
{
35
public
:
36
37
using
Base
=
HttpClient
;
38
39
//Creates client, initializes curl handle if it hasn't been created already.
40
CurlHttpClient
(
const
Aws::Client::ClientConfiguration
& clientConfig);
41
//Makes request and receives response synchronously
42
std::shared_ptr<HttpResponse> MakeRequest(
HttpRequest
& request,
Aws::Utils::RateLimits::RateLimiterInterface
* readLimiter =
nullptr
,
43
Aws::Utils::RateLimits::RateLimiterInterface
* writeLimiter =
nullptr
)
const
;
44
45
static
void
InitGlobalState();
46
static
void
CleanupGlobalState();
47
48
private
:
49
mutable
CurlHandleContainer
m_curlHandleContainer;
50
bool
m_isUsingProxy;
51
Aws::String
m_proxyUserName;
52
Aws::String
m_proxyPassword;
53
Aws::String
m_proxyHost;
54
unsigned
m_proxyPort;
55
bool
m_verifySSL;
56
Aws::String
m_caPath;
57
bool
m_allowRedirects;
58
59
static
std::atomic<bool> isInit;
60
61
//Callback to read the content from the content body of the request
62
static
size_t
ReadBody(
char
* ptr,
size_t
size,
size_t
nmemb,
void
* userdata);
63
//callback to write the content from the response to the response object
64
static
size_t
WriteData(
char
* ptr,
size_t
size,
size_t
nmemb,
void
* userdata);
65
//callback to write the headers from the response to the response
66
static
size_t
WriteHeader(
char
* ptr,
size_t
size,
size_t
nmemb,
void
* userdata);
67
68
};
69
70
using
PlatformHttpClient
=
CurlHttpClient
;
71
72
}
// namespace Http
73
}
// namespace Aws
74
Aws::Http::HttpRequest
Definition:
HttpRequest.h:65
Aws::Utils::RateLimits::RateLimiterInterface
Definition:
RateLimiterInterface.h:33
Aws::Http::HttpClient
Definition:
HttpClient.h:43
ClientConfiguration.h
AWSString.h
HttpClient.h
Aws::String
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition:
AWSString.h:97
Aws::Client::ClientConfiguration
Definition:
ClientConfiguration.h:48
CurlHandleContainer.h
Aws::Http::CurlHandleContainer
Definition:
CurlHandleContainer.h:36
Core_EXPORTS.h
Aws::Http::CurlHttpClient
Definition:
CurlHttpClient.h:33
AWS_CORE_API
#define AWS_CORE_API
Definition:
Core_EXPORTS.h:35
Aws
JSON (JavaScript Object Notation).
Definition:
AccessManagementClient.h:24
Generated by
1.8.11