Files
swebs/site/library.c
2022-04-11 01:56:49 -05:00

18 lines
547 B
C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <swebs/swebs.h>
int getResponse(Request *request, Response *response) {
printf("%d\n", request->path.fieldCount);
for (int i = 0; i < request->path.fieldCount; i++)
printf("%s: %s\n", request->path.fields[i].var.data, request->path.fields[i].value.data);
char *str = request->path.path.data;
response->type = BUFFER;
response->response.buffer.data = malloc(100);
strcpy(response->response.buffer.data, str);
response->response.buffer.len = strlen(str);
return 200;
}