FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
NFHTTP/include/NFHTTP/Client.h at master · nativeformat/NFHTTP · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
nativeformat
/
NFHTTP
Public
Notifications
You must be signed in to change notification settings
Fork
35
Star
586
Code
Issues
12
Pull requests
4
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
NFHTTP
/
include
/
NFHTTP
/
Client.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
76 lines (67 loc) · 2.95 KB
Breadcrumbs
NFHTTP
/
include
/
NFHTTP
/
Client.h
Copy path
File metadata and controls
76 lines (67 loc) · 2.95 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Copyright (c) 2017 Spotify AB.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#
pragma
once
#
include
<
NFHTTP/Request.h
>
#
include
<
NFHTTP/RequestToken.h
>
#
include
<
NFHTTP/Response.h
>
#
include
<
functional
>
#
include
<
memory
>
#
include
<
mutex
>
#
include
<
string
>
#
include
<
vector
>
namespace
nativeformat
{
namespace
http
{
typedef
std::function<
void
(std::function<
void
(
const
std::shared_ptr<Request> &request)> callback,
const
std::shared_ptr<Request> &request)>
REQUEST_MODIFIER_FUNCTION
;
typedef
std::function<
void
(
std::function<
void
(
const
std::shared_ptr<Response> &response,
bool
retry)> callback,
const
std::shared_ptr<Response> &response)>
RESPONSE_MODIFIER_FUNCTION
;
extern
const
REQUEST_MODIFIER_FUNCTION
DO_NOT_MODIFY_REQUESTS_FUNCTION
;
extern
const
RESPONSE_MODIFIER_FUNCTION
DO_NOT_MODIFY_RESPONSES_FUNCTION
;
class
Client
{
public:
virtual
~Client
();
virtual
std::shared_ptr<RequestToken>
performRequest
(
const
std::shared_ptr<Request> &request,
std::function<
void
(
const
std::shared_ptr<Response> &)> callback) = 0;
virtual
const
std::shared_ptr<Response>
performRequestSynchronously
(
const
std::shared_ptr<Request> &request);
virtual
void
pinResponse
(
const
std::shared_ptr<Response> &response,
const
std::string &pin_identifier);
virtual
void
unpinResponse
(
const
std::shared_ptr<Response> &response,
const
std::string &pin_identifier);
virtual
void
removePinnedResponseForIdentifier
(
const
std::string &pin_identifier);
virtual
void
pinnedResponsesForIdentifier
(
const
std::string &pin_identifier,
std::function<
void
(
const
std::vector<std::shared_ptr<Response>> &)> callback);
virtual
void
pinningIdentifiers
(
std::function<
void
(
const
std::vector<std::string> &identifiers)> callback);
};
extern
std::shared_ptr<Client>
createClient
(
const
std::string &cache_location,
const
std::string &user_agent,
REQUEST_MODIFIER_FUNCTION
request_modifier_function =
DO_NOT_MODIFY_REQUESTS_FUNCTION
,
RESPONSE_MODIFIER_FUNCTION
response_modifier_function =
DO_NOT_MODIFY_RESPONSES_FUNCTION
);
extern
std::string
standardCacheLocation
();
}
//
namespace http
}
//
namespace nativeformat
Back
|
FazBrowse Home
|
New Git URL