]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add register user to scanner
authorBastian Dehn <hhaalo@arcor.de>
Sat, 20 Jan 2024 20:51:12 +0000 (21:51 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 20 Jan 2024 20:51:12 +0000 (21:51 +0100)
src/kds_s2000w_handler.c

index b043fdf6a0ac99d9ab9d9689593a5e7d61f5933a..78dd43666e8af094a1a3a134929eabd7676e3bf8 100644 (file)
@@ -8,9 +8,13 @@ void* kds_s2000w_handler_open()
        printf("open\n");
        CURL *curl = curl_easy_init();
        if(curl) {
+               printf("curl\n");
                CURLcode res;
-               curl_easy_setopt(curl, CURLOPT_URL, "https://scanner.lan.hhaalo.de");
+               curl_easy_setopt(curl, CURLOPT_URL, "http://scanner.lan.hhaalo.de/api/session");
+               curl_easy_setopt(curl, CURLOPT_POST, 1L);
+               curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"OCPUserName\":\"hhaalo\"}");
                res = curl_easy_perform(curl);
+               printf("curlcode: %li\n", res);
                curl_easy_cleanup(curl);
        }
        return NULL;