Debian Codegraph @

source/http.h

raw symbols SCIP
1 #ifndef AWS_CRT_PYTHON_HTTP_H
2 #define AWS_CRT_PYTHON_HTTP_H
3 /**
4 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * SPDX-License-Identifier: Apache-2.0.
6 */
7 #include "module.h"
8
9 struct aws_http_headers;
10 struct aws_http_message;
11 struct aws_http_proxy_options;
12
13 /**
14 * Init aws_http_proxy_options from HttpProxyOptions.
15 * Returns false and sets python exception if error occurred.
16 *
17 * NOTE: The native struct must be used immediately because it's cursors
18 * reference memory from strings in the PyObject.
19 * If we need this struct to be a long-lived object, we'll need to do a full binding.
20 */
21 bool aws_py_http_proxy_options_init(struct aws_http_proxy_options *proxy_options, PyObject *py_proxy_options);
22
23 /**
24 * Close the connection if it's open.
25 */
26 PyObject *aws_py_http_connection_close(PyObject *self, PyObject *args);
27
28 /**
29 * Returns True if connection is open and usable, False otherwise.
30 */
31 PyObject *aws_py_http_connection_is_open(PyObject *self, PyObject *args);
32
33 /**
34 * Update HTTP/2 connection window size.
35 */
36 PyObject *aws_py_http2_connection_update_window(PyObject *self, PyObject *args);
37
38 /**
39 * Update HTTP stream window size.
40 */
41 PyObject *aws_py_http_stream_update_window(PyObject *self, PyObject *args);
42
43 /**
44 * Create a new connection. returns void. The on_setup callback will be invoked
45 * upon either success or failure of the connection.
46 */
47 PyObject *aws_py_http_client_connection_new(PyObject *self, PyObject *args);
48
49 PyObject *aws_py_http_client_stream_new(PyObject *self, PyObject *args);
50 PyObject *aws_py_http_client_stream_activate(PyObject *self, PyObject *args);
51
52 PyObject *aws_py_http2_client_stream_write_data(PyObject *self, PyObject *args);
53
54 /* Create capsule around new request-style aws_http_message struct */
55 PyObject *aws_py_http_message_new_request(PyObject *self, PyObject *args);
56
57 /* Create capsule to bind existing request-style aws_http_message struct. */
58 PyObject *aws_py_http_message_new_request_from_native(struct aws_http_message *request);
59
60 PyObject *aws_py_http_message_get_request_method(PyObject *self, PyObject *args);
61 PyObject *aws_py_http_message_set_request_method(PyObject *self, PyObject *args);
62 PyObject *aws_py_http_message_get_request_path(PyObject *self, PyObject *args);
63 PyObject *aws_py_http_message_set_request_path(PyObject *self, PyObject *args);
64 PyObject *aws_py_http_message_set_body_stream(PyObject *self, PyObject *args);
65
66 /* Create capsule to bind existing aws_http_headers struct. */
67 PyObject *aws_py_http_headers_new_from_native(struct aws_http_headers *headers);
68
69 /* Create capsule around new aws_http_headers struct */
70 PyObject *aws_py_http_headers_new(PyObject *self, PyObject *args);
71
72 PyObject *aws_py_http_headers_add(PyObject *self, PyObject *args);
73 PyObject *aws_py_http_headers_add_pairs(PyObject *self, PyObject *args);
74 PyObject *aws_py_http_headers_set(PyObject *self, PyObject *args);
75 PyObject *aws_py_http_headers_get(PyObject *self, PyObject *args);
76 PyObject *aws_py_http_headers_get_index(PyObject *self, PyObject *args);
77 PyObject *aws_py_http_headers_count(PyObject *self, PyObject *args);
78 PyObject *aws_py_http_headers_remove(PyObject *self, PyObject *args);
79 PyObject *aws_py_http_headers_remove_value(PyObject *self, PyObject *args);
80 PyObject *aws_py_http_headers_clear(PyObject *self, PyObject *args);
81
82 /* Given a python object, return a pointer to its underlying native type.
83 * If NULL is returned, a python error has been set */
84
85 struct aws_http_connection *aws_py_get_http_connection(PyObject *connection);
86 struct aws_http_stream *aws_py_get_http_stream(PyObject *stream);
87 struct aws_http_message *aws_py_get_http_message(PyObject *http_message);
88 struct aws_http_headers *aws_py_get_http_headers(PyObject *http_headers);
89
90 #endif /* AWS_CRT_PYTHON_HTTP_H */