davidmoreno / onion

C library to create simple HTTP servers and Web Applications.
http://www.coralbits.com/libonion/
Other
2.01k stars 250 forks source link

How to get data passed using "Content-Type: text/plain"? #267

Closed alexe100 closed 4 years ago

alexe100 commented 4 years ago

Hi I am trying to extract data passaed using this type of request but no success until now:

curl -X POST -H "Content-Type: text/plain" --data "0201060DFF9904FFCAFE00048313220BE3" http://127.0.0.1:8080/data

... const onion_dict post = onion_request_get_post_dict(req); onion_block bl = onion_dict_to_json((onion_dict *)post);
printf("BLOCK POST: %s\n", onion_block_data(bl)); onion_block_free(bl); ...

How to get raw data from request?

Thanks a lot Alex

alexe100 commented 4 years ago

onion_request_get_data