mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 06:25:04 +00:00
[http.c] new file.
This commit is contained in:
parent
2766fbd49c
commit
9a38cfb70f
2 changed files with 23 additions and 1 deletions
4
Makefile
4
Makefile
|
@ -2,7 +2,7 @@ CFLAGS=-g -Wall
|
|||
|
||||
all: snac
|
||||
|
||||
snac: snac.o main.o data.o
|
||||
snac: snac.o main.o data.o http.o
|
||||
$(CC) -L/usr/local/lib *.o -lcurl -lcrypto -o $@
|
||||
|
||||
.c.o:
|
||||
|
@ -17,3 +17,5 @@ snac.o: snac.c snac.h \
|
|||
main.o: main.c snac.h xs.h
|
||||
|
||||
data.o: data.c snac.h xs.h xs_json.h
|
||||
|
||||
http.o: http.c snac.h xs.h xs_io.h xs_encdec.h xs_openssl.h xs_curl.h
|
||||
|
|
20
http.c
Normal file
20
http.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
|
||||
#include "xs.h"
|
||||
#include "xs_io.h"
|
||||
#include "xs_encdec.h"
|
||||
#include "xs_openssl.h"
|
||||
#include "xs_curl.h"
|
||||
|
||||
#include "snac.h"
|
||||
|
||||
d_char *http_signed_request(snac *snac, char *method, char *url,
|
||||
d_char *headers,
|
||||
d_char *body, int b_size,
|
||||
int *status, d_char **payload, int *p_size)
|
||||
/* does an HTTP request */
|
||||
{
|
||||
return xs_http_request(method, url, headers,
|
||||
body, b_size, status, payload, p_size);
|
||||
}
|
Loading…
Reference in a new issue