return NOTCONNECTED;
response resp = {0};
- curl_easy_setopt(curl, CURLOPT_URL, "http://scanner.lan.hhaalo.de/api/session");
+ CURLU* url_handler = curl_url();
+ curl_url_set(url_handler, CURLUPART_URL, "http://scanner.lan.hhaalo.de/api/session", 0);
+ char* url = NULL;
+ curl_url_get(url_handler, CURLUPART_URL, &url, 0);
+ curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"OCPUserName\":\"hhaalo\"}");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
resObj = NULL;
curl_easy_cleanup(curl);
curl = NULL;
+ curl_url_cleanup(url_handler);
+ url_handler = NULL;
+ curl_free(url);
+ url = NULL;
return returnState;
}