2 * Copyright (c) 2019-2020 Apple Inc. All rights reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __HTTPUtilities_h
18 #define __HTTPUtilities_h
20 #include <dispatch/dispatch.h>
21 #include <nw/private.h>
24 create_base64_string(dispatch_data_t message
);
27 http_set_resolver_queue(dispatch_queue_t queue
);
29 typedef void (^http_task_dns_query_response_handler_t
)(dispatch_data_t data
, CFErrorRef error
);
32 http_task_create_dns_query(nw_endpoint_t endpoint
,
33 const char *url_string
,
34 dispatch_data_t message
,
37 http_task_dns_query_response_handler_t response_handler
);
40 http_task_create_pvd_query(dispatch_queue_t queue
,
43 void (^response_handler
)(xpc_object_t json_object
));
46 http_task_start(void *task
);
49 http_task_cancel(void *task
);
51 #endif // __HTTPUtilities_h