-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can not get post data by example "post" #287
Comments
Can you try using onion_request_get_data.
|
the req->data is null if I input the format as --data "key1=xx&key2=xxx",onion_request_get_post(x,key1)can get the data, in the func "parse_POST_urlencode",token->extra can get the raw data,but "token->extra = NULL" before return " will dissipates it
|
onion_request_get_data will get req->data
i have debuged it ,onion_request_get_data will get req->data |
oh,I can get raw data by req->POST->root->data->key, |
i send date by curl,but can't get any data
i trace it, the dict's key was data,not content-type,is it bug?
debug info:
onion_dict_find_node (d=0x615df0, current=0x62a220, key=0x400e58 "application", parent=0x0) at */onion-master/src/onion/dict.c:231
231 if (!current) {
(gdb) n
234 int cmp = d->cmp(key, current->data.key);
(gdb) p key
$79 = 0x400e58 "application" #### I modify the example (text->application)
(gdb) p current->data.key #### it is debug data saved to dict
$80 = 0x615da0 "{"input_1": "111sunshine"}"
the cmd i used:
curl --trace test.txt --data '{"input_1": "111sunshine"}' http://127.0.0.1:8080/data
The text was updated successfully, but these errors were encountered: