We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I know websock_send support send a JSON data like this: EOR(websock_send(client->ws_connection, WEBSOCK_TEXT, "%H", json_encode_odict, dict));
EOR(websock_send(client->ws_connection, WEBSOCK_TEXT, "%H", json_encode_odict, dict));
So I want use http_request send a JSON data in this way:
{ (void)re_snprintf(url, sizeof(url),"http://101.69.114.92:%u/report/", 80); struct odict* post_dict; EOR(odict_alloc(&post_dict, 16)); char type[16] = "play-interval"; char customid[128] = "google.cn"; EOR(odict_entry_add(post_dict, "0017", ODICT_STRING, type)); EOR(odict_entry_add(post_dict, "0009", ODICT_STRING, customid)); //Test POST err = http_request(&req, cli, "POST", url, http_resp_handler, NULL, &t, "%H", json_encode_odict, post_dict); if (err) { DEBUG_PRINTF("exit\n"); goto out; } }
This produce a wrong tcp packet.
Does I use the wrong method of http_request ?
Thank you.
btw: I can't find example of http_request(POST) in retest, rawrtc and libre,
The text was updated successfully, but these errors were encountered:
The http_request fmt argument takes both headers and body. Example usage:
http_request(..., "Content-Type: application/json\r\n" "Content-Length: %zu\r\n" "\r\n" "%s", str_len(body), body);
Sorry, something went wrong.
No branches or pull requests
I know websock_send support send a JSON data like this:
EOR(websock_send(client->ws_connection, WEBSOCK_TEXT, "%H", json_encode_odict, dict));
So I want use http_request send a JSON data in this way:
This produce a wrong tcp packet.
Does I use the wrong method of http_request ?
Thank you.
btw: I can't find example of http_request(POST) in retest, rawrtc and libre,
The text was updated successfully, but these errors were encountered: