Send base64 by url
Posted: Sun Dec 09, 2018 8:49 pm
Hi, this is my first post here. First of all, sorry for my english.
I have a problem:
I have a server pointing to raspberry server wich expects a JSON object.
When i pass parameters directly to raspberry server, there is no problem, it recive fine, but when i pass the parameters redirecting there is no answer. Every change if i encode base64 my JSON and send it, all works!. But when i try to implement in IDF doesnt work.
///////////////////////////ENCODING JSON//////////////////////////////////////////////////////////
char* to_Encode = "{\"user_usr\":\"DeviceUsr\",\"user_psw\":\"DevicePsw\"}";
size_t outPutLenght;
unsigned char * coded = base64_encode((const unsigned char *)to_Encode, strlen(to_Encode), &outPutLenght);
char* coded_send = (const char *)coded;
char* server_service_get_token = "http://myhost/user_login/";
char* full_service_token =concatb(server_service_get_token,coded_send);
///////////////////////////////CONFIGURE HTTP REQ//////////////////////////////////
esp_http_client_config_t config = {
.url = full_service_token,
.event_handler = _http_event_handler,
};
//////////////////////////////ERROR /////////////////////////////////////////////////////////
Error parse url http://myhost/user_login/eyJ1c2VyX3Vzci ... NlUHN3In0=
HTTP_CLIENT: Error set default configurations
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
But if i do this on . url works!, WTFF
esp_http_client_config_t config = {
.url = "http://myhost/user_login/eyJ1c2VyX3Vzci ... NlUHN3In0=",
.event_handler = _http_event_handler,
};
Any idea?
I have a problem:
I have a server pointing to raspberry server wich expects a JSON object.
When i pass parameters directly to raspberry server, there is no problem, it recive fine, but when i pass the parameters redirecting there is no answer. Every change if i encode base64 my JSON and send it, all works!. But when i try to implement in IDF doesnt work.
///////////////////////////ENCODING JSON//////////////////////////////////////////////////////////
char* to_Encode = "{\"user_usr\":\"DeviceUsr\",\"user_psw\":\"DevicePsw\"}";
size_t outPutLenght;
unsigned char * coded = base64_encode((const unsigned char *)to_Encode, strlen(to_Encode), &outPutLenght);
char* coded_send = (const char *)coded;
char* server_service_get_token = "http://myhost/user_login/";
char* full_service_token =concatb(server_service_get_token,coded_send);
///////////////////////////////CONFIGURE HTTP REQ//////////////////////////////////
esp_http_client_config_t config = {
.url = full_service_token,
.event_handler = _http_event_handler,
};
//////////////////////////////ERROR /////////////////////////////////////////////////////////
Error parse url http://myhost/user_login/eyJ1c2VyX3Vzci ... NlUHN3In0=
HTTP_CLIENT: Error set default configurations
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
But if i do this on . url works!, WTFF
esp_http_client_config_t config = {
.url = "http://myhost/user_login/eyJ1c2VyX3Vzci ... NlUHN3In0=",
.event_handler = _http_event_handler,
};
Any idea?