[ADD/WIP] Add some HTTP request code

We can now *register* users!
This commit is contained in:
LDA 2024-06-13 09:35:57 +02:00
commit 0fa95c2d14
12 changed files with 320 additions and 11 deletions

View file

@ -3,16 +3,21 @@
#include <Cytoplasm/HttpServer.h>
#include <Cytoplasm/HttpRouter.h>
#include <Cytoplasm/HttpClient.h>
#include <Cytoplasm/Stream.h>
typedef struct ParseeConfig {
char *as_token, *hs_token;
char *as_token, *hs_token;
/* id here is "Parsee XMPP". */
char *sender_localpart;
char *namespace_base;
char *sender_localpart;
char *namespace_base;
char *listen_as;
int port;
char *listen_as;
int port;
/* Homeserver port info */
char *homeserver_host;
int homeserver_port;
} ParseeConfig;
typedef struct ParseeData {
@ -42,4 +47,9 @@ extern void ParseeFreeData(ParseeData *);
/* HTTP server handler for Parsee, takes in a config. */
extern void ParseeRequest(HttpServerContext *, void *);
extern HttpClientContext * ParseeCreateRequest(ParseeConfig *, HttpRequestMethod, char *);
/* Sends headers, and writes the JSON object. */
extern HttpStatus ParseeSetRequestJSON(HttpClientContext *, HashMap *);
#endif