You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include "mastodon_api.h"
|
|
|
|
#include "http_server/http_request.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "form.h"
|
|
|
|
|
|
|
|
bool route_mastodon_api( struct http_request* req )
|
|
|
|
{
|
|
|
|
if( http_request_route( req, "apps" ) ) {
|
|
|
|
if( http_request_route_method( req, "POST" ) ) {
|
|
|
|
FILE* data = http_request_get_request_data( req );
|
|
|
|
printf( "OAuth2 app\n" );
|
|
|
|
|
|
|
|
struct form_parser* fp = form_pull_parser_new( data );
|
|
|
|
if( !fp ) { return false; }
|
|
|
|
|
|
|
|
char* key;
|
|
|
|
while( key = form_pull_parser_read_key( fp ) ) {
|
|
|
|
printf( "key: %s\n", key );
|
|
|
|
printf( "vakue: %s\n", form_pull_parser_read_value(fp) );
|
|
|
|
}
|
|
|
|
|
|
|
|
form_pull_parser_release(fp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|