This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ #ifndef http_h
2
+ #define http_h
3
+
4
+ typedef struct http_context_s http_context ;
5
+ typedef struct http_session_s http_session ;
6
+ typedef struct http_request_s http_request ;
7
+
8
+ /*
9
+ * A Context is bound to a collection of sessions and
10
+ * ongoing requests. Each thread in a process should have its
11
+ * own Context to avoid deadlocks and conflicts.
12
+ */
13
+ http_context * http_context_create ();
14
+ void http_context_release (http_context * ctx );
15
+
16
+ /*
17
+ * A session represents an active communication line to a server.
18
+ * One or more network sockets may be open to the server to
19
+ * fulfill requests. Pipelining will be used if supported by server.
20
+ */
21
+ http_session * http_session_open (http_context * ctx , const char * host , int port );
22
+ void http_session_close (http_session * session );
23
+
24
+ http_request * http_request_create (http_session * session , const char * path , http_method method );
25
+ http_request * http_request_get (http_session * session , const char * path );
26
+ http_request * http_request_post (http_session * session , const char * path );
27
+
28
+ #endif
You can’t perform that action at this time.
0 commit comments