Curl 7 82 0
Author: c | 2025-04-24
Blitz Chess 1 point 8 matches. Checkers 0 points 7 matches Backgammon 0 points 7 matches Curling 0 points 7 matches
curlimages/curl:8.1.0 fails on a simple GET Issue 82 curl/curl
Hope 1:36.0 AT 7 21-Aug-82 Won 14 ran 13-8f G Willetts 58 Moonee Valley 1200m Freeway Stakes Qubeau 1:10.8 4-Sep-82 Won 8 ran 7-4f G Willetts 58.5 Caulfield 1400m Memsie Stakes Galleon 1:24.0 18-Sep-82 3rd 7 ran 4-5f G Willetts 58.5 Moonee Valley 1600m Feehan Stakes Lawman 1:35.5 23-Oct-82 Won 11 ran 9-2 G Willetts 58 Moonee Valley 1000m A J Moir Stakes Razor Sharp 0:58.9 30-Oct-82 3rd 15 ran 6-1 G Willetts 59.5 Flemington 1200m Pure Pak Stakes Forgone Conclusion 1:09.7 4-Nov-82 3rd 4 ran 9-4 G Willetts 58 Flemington 1400m Linlithgow Stakes Galleon 1:24.3 31-Jan-83 Won 9 ran 10-9f G Willetts 57.5 Moonee Valley 1200m William Reid Stakes Torbek 1:10.2 19-Feb-83 2nd 15 ran 5-2ef G Willetts 57 Flemington 1000m Lightning Stakes Demus 0:57.3 5-Mar-83 Won 8 ran 7-4 G Willetts 57.5 Caulfield 1400m Futurity Stakes Avatar 1:24.3 19-Mar-83 2nd 14 ran 9-2 G Willetts 57.5 Rosehill 1400m George Ryder Stakes Emancipation 1:22.8 Horse racing systems and research. Blitz Chess 1 point 8 matches. Checkers 0 points 7 matches Backgammon 0 points 7 matches Curling 0 points 7 matches curl version 7.32.0 was released on August 12 2025. It has the following 82 published security problems. Flaw From version To and including; gzip integer overflow: 7. Egypt Lake-Leto is located in northwestern Hillsborough County at 28 0′55″N 82 30′26″W / 28. N 82. W / 28. ; -82. (28. , -82. ), 7 miles (11 km) %PDF-1.7 1 0 obj stream ? stream ? JFIF ? ?C $.', (7), '9=82 TOB-CURL-11 (Unused memory blocks are not freed, resulting in memory leaks) cURL allocates blocks of memory that are not freed when they are no longer needed, leading to memory leaks. This issue is fixed in cURL 7.87.0. To reproduce the bug, use the following commands: $ curl 0 -Z 0 -Tz 0 $ curl 00 -cu 00 $ curl -proto =0 -proto =0 Dockerfile curl version 7.39.0 was released on November 5 2025. It has the following 82 published security problems. (20):} [52 bytes data]SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384ALPN: server accepted http/1.1Server certificate:subject: CN=ubuntustart date: Feb 10 15:24:51 2023 GMTexpire date: Feb 7 15:24:51 2033 GMTissuer: CN=ubuntuSSL certificate verify result: self-signed certificate (18), continuing anyway.using HTTP/1.1} [5 bytes data]GET / HTTP/1.1Host: 127.0.0.1User-Agent: curl/7.88.1-DEVAccept: /{ [5 bytes data]TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):{ [230 bytes data]TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):{ [230 bytes data]old SSL session ID is stale, removing{ [5 bytes data]{ [10701 bytes data]################################################################################################################################ 100.0%* Connection #0 to host 127.0.0.1 left intactExcpeted is to not fall back to http1.1 and expected result should look something like this belowroot@ubuntu:~# curl -# -v -k --http3 -o index.html 127.0.0.1:443...Skipped certificate verificationConnected to 127.0.0.1 (127.0.0.1) port 443 (#0)using HTTP/3h2h3 [:method: GET]h2h3 [:path: /]h2h3 [:scheme: https]h2h3 [:authority: 127.0.0.1]h2h3 [user-agent: curl/7.88.1-DEV]h2h3 [accept: /]Using HTTP/3 Stream ID: 0 (easy handle 0x556d310dff30)GET / HTTP/3Host: 127.0.0.1user-agent: curl/7.88.1-DEVaccept: /{ [3483 bytes data]################################################################################################################################ 100.0%* Connection #0 to host 127.0.0.1 left intactroot@ubuntu:~# curl -Vcurl 7.88.1-DEV (x86_64-pc-linux-gnu) libcurl/7.88.1-DEV OpenSSL/3.0.0 zlib/1.2.11 brotli/1.0.9 ngtcp2/0.14.0-DEV nghttp3/0.9.0-DEVRelease-Date: [unreleased]Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftpFeatures: alt-svc AsynchDNS brotli HSTS HTTP3 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe TLS-SRP UnixSocketsPRETTY_NAME="Ubuntu 22.04.1 LTS"NAME="Ubuntu"VERSION_ID="22.04"VERSION="22.04.1 LTS (Jammy Jellyfish)"root@ubuntu:# nginx -Vnginx version: nginx/1.23.4 (nginx-quic)built by gcc 11.3.0 (Ubuntu 11.3.0-1ubuntu122.04)built with OpenSSL 1.1.1 (compatible; BoringSSL) (running with BoringSSL)TLS SNI support enabledconfigure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_moduleComments
Hope 1:36.0 AT 7 21-Aug-82 Won 14 ran 13-8f G Willetts 58 Moonee Valley 1200m Freeway Stakes Qubeau 1:10.8 4-Sep-82 Won 8 ran 7-4f G Willetts 58.5 Caulfield 1400m Memsie Stakes Galleon 1:24.0 18-Sep-82 3rd 7 ran 4-5f G Willetts 58.5 Moonee Valley 1600m Feehan Stakes Lawman 1:35.5 23-Oct-82 Won 11 ran 9-2 G Willetts 58 Moonee Valley 1000m A J Moir Stakes Razor Sharp 0:58.9 30-Oct-82 3rd 15 ran 6-1 G Willetts 59.5 Flemington 1200m Pure Pak Stakes Forgone Conclusion 1:09.7 4-Nov-82 3rd 4 ran 9-4 G Willetts 58 Flemington 1400m Linlithgow Stakes Galleon 1:24.3 31-Jan-83 Won 9 ran 10-9f G Willetts 57.5 Moonee Valley 1200m William Reid Stakes Torbek 1:10.2 19-Feb-83 2nd 15 ran 5-2ef G Willetts 57 Flemington 1000m Lightning Stakes Demus 0:57.3 5-Mar-83 Won 8 ran 7-4 G Willetts 57.5 Caulfield 1400m Futurity Stakes Avatar 1:24.3 19-Mar-83 2nd 14 ran 9-2 G Willetts 57.5 Rosehill 1400m George Ryder Stakes Emancipation 1:22.8 Horse racing systems and research
2025-04-12(20):} [52 bytes data]SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384ALPN: server accepted http/1.1Server certificate:subject: CN=ubuntustart date: Feb 10 15:24:51 2023 GMTexpire date: Feb 7 15:24:51 2033 GMTissuer: CN=ubuntuSSL certificate verify result: self-signed certificate (18), continuing anyway.using HTTP/1.1} [5 bytes data]GET / HTTP/1.1Host: 127.0.0.1User-Agent: curl/7.88.1-DEVAccept: /{ [5 bytes data]TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):{ [230 bytes data]TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):{ [230 bytes data]old SSL session ID is stale, removing{ [5 bytes data]{ [10701 bytes data]################################################################################################################################ 100.0%* Connection #0 to host 127.0.0.1 left intactExcpeted is to not fall back to http1.1 and expected result should look something like this belowroot@ubuntu:~# curl -# -v -k --http3 -o index.html 127.0.0.1:443...Skipped certificate verificationConnected to 127.0.0.1 (127.0.0.1) port 443 (#0)using HTTP/3h2h3 [:method: GET]h2h3 [:path: /]h2h3 [:scheme: https]h2h3 [:authority: 127.0.0.1]h2h3 [user-agent: curl/7.88.1-DEV]h2h3 [accept: /]Using HTTP/3 Stream ID: 0 (easy handle 0x556d310dff30)GET / HTTP/3Host: 127.0.0.1user-agent: curl/7.88.1-DEVaccept: /{ [3483 bytes data]################################################################################################################################ 100.0%* Connection #0 to host 127.0.0.1 left intactroot@ubuntu:~# curl -Vcurl 7.88.1-DEV (x86_64-pc-linux-gnu) libcurl/7.88.1-DEV OpenSSL/3.0.0 zlib/1.2.11 brotli/1.0.9 ngtcp2/0.14.0-DEV nghttp3/0.9.0-DEVRelease-Date: [unreleased]Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftpFeatures: alt-svc AsynchDNS brotli HSTS HTTP3 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe TLS-SRP UnixSocketsPRETTY_NAME="Ubuntu 22.04.1 LTS"NAME="Ubuntu"VERSION_ID="22.04"VERSION="22.04.1 LTS (Jammy Jellyfish)"root@ubuntu:# nginx -Vnginx version: nginx/1.23.4 (nginx-quic)built by gcc 11.3.0 (Ubuntu 11.3.0-1ubuntu122.04)built with OpenSSL 1.1.1 (compatible; BoringSSL) (running with BoringSSL)TLS SNI support enabledconfigure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module
2025-04-06File included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^1 warning generated.Compiling NewSecurityTokenKeyfileDialog.cppIn file included from Forms/NewSecurityTokenKeyfileDialog.cpp:14:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^1 warning generated.Compiling PreferencesDialog.cppIn file included from Forms/PreferencesDialog.cpp:21:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^1 warning generated.Compiling ProgressWizardPage.cppIn file included from Forms/ProgressWizardPage.cpp:14:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^1 warning generated.Compiling RandomPoolEnrichmentDialog.cppIn file included from Forms/RandomPoolEnrichmentDialog.cpp:14:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^Forms/RandomPoolEnrichmentDialog.cpp:31:17: warning: expression with side effects will be evaluated despite being used as an operand to 'typeid' [-Wpotentially-evaluated-expression] if (typeid (*hash) == typeid (*RandomNumberGenerator::GetHash())) ^Forms/RandomPoolEnrichmentDialog.cpp:31:35: warning: expression with side effects will be evaluated despite being used as an operand to 'typeid' [-Wpotentially-evaluated-expression] if (typeid (*hash) == typeid (*RandomNumberGenerator::GetHash())) ^3 warnings generated.Compiling SecurityTokenKeyfilesDialog.cppIn file included from Forms/SecurityTokenKeyfilesDialog.cpp:14:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^1 warning generated.Compiling SelectDirectoryWizardPage.cppIn file included from Forms/SelectDirectoryWizardPage.cpp:14:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^1 warning generated.Compiling VolumePasswordPanel.cppIn file included from Forms/VolumePasswordPanel.cpp:14:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^1 warning generated.Compiling VolumePropertiesDialog.cppIn file included from Forms/VolumePropertiesDialog.cpp:15:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^1 warning generated.Compiling VolumeCreationProgressWizardPage.cppIn file included from Forms/VolumeCreationProgressWizardPage.cpp:14:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int GetCharWidth (wxWindow *window) const ^/usr/local/include/wx-3.0/wx/gtk/window.h:92:17: note: hidden overloaded virtual function 'wxWindow::GetCharWidth' declared here: different number of parameters (0 vs 1) virtual int GetCharWidth() const; ^1 warning generated.Compiling VolumeCreationWizard.cppIn file included from Forms/VolumeCreationWizard.cpp:22:In file included from /wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/GraphicUserInterface.h:20:/wrkdirs/usr/ports/security/veracrypt/work/veracrypt-1.23_2/src/Main/Forms/WaitDialog.h:82:7: warning: 'VeraCrypt::WaitDialog::GetCharWidth' hides overloaded virtual function [-Woverloaded-virtual] int
2025-04-14NoticeThe URL of the result image is valid for 1 hour. Please download the image file promptly.Supported ImagesFormatResolutionFile sizejpg, jpeg, bmp, png, webp, tiff, tif, bitmap, raw, rgb, jfif, lzwUp to 4096 x 4096Up to 15MBGet StartedSee differences between the 3 API call types #Create a task.curl -k ' \-H 'X-API-KEY: YOUR_API_KEY' \-F 'sync=0' \-F 'image_url=YOU_IMG_URL'#Get the cutout result#Polling requests using the following methods 1. The polling interval is set to 1 second, 2. The polling time does not exceed 30 secondscurl -k ' \-H 'X-API-KEY: YOUR_API_KEY' \php//Create a task$curl = curl_init();curl_setopt($curl, CURLOPT_URL, ' CURLOPT_HTTPHEADER, array( "X-API-KEY: YOUR_API_KEY", "Content-Type: multipart/form-data",));curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);curl_setopt($curl, CURLOPT_POST, true);curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($curl, CURLOPT_POSTFIELDS, array('sync' => 0, 'image_url' => "YOUR_IMG_URL"));$response = curl_exec($curl);$result = curl_errno($curl) ? curl_error($curl) : $response;curl_close($curl);$result = json_decode($result, true);if ( !isset($result["status"]) || $result["status"] != 200 ) { // request failed, log the details var_dump($result); die("post request failed");}// var_dump($result);$task_id = $result["data"]["task_id"];//get the task result// 1、"The polling interval is set to 1 second."//2 "The polling time is around 30 seconds."for ($i = 1; $i 30; $i++) { if ($i != 1) { sleep(1); } $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, " curl_setopt($curl, CURLOPT_HTTPHEADER, array( "X-API-KEY: YOUR_API_KEY", )); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); $result = curl_errno($curl) ? curl_error($curl) : $response; curl_close($curl); var_dump($result); $result = json_decode($result, true); if ( !isset($result["status"]) || $result["status"] != 200 ) { // Task exception, logging the error. //You can choose to continue the loop with 'continue' or break the loop with 'break' var_dump($result); continue; } if ( $result["data"]["state"] == 1 ) { // task success var_dump($result["data"]["image"]); break; } else if ( $result["data"]["state"] 0) { // request failed, log the details var_dump($result); break; } else { // Task processing if ($i == 30) { //Task processing, abnormal situation, seeking assistance from customer service of picwish } }}public static void main(String[] args) throws Exception { String taskId = createTask(); String result = pollingTaskResult(taskId, 0); System.out.println(result);}private static String createTask() throws Exception { OkHttpClient okHttpClient = new OkHttpClient.Builder().build(); RequestBody requestBody = new MultipartBody.Builder() .setType(MultipartBody.FORM) .addFormDataPart("image_url", "IMAGE_HTTP_URL") .addFormDataPart("sync", "0") .build(); Request request = new Request.Builder() .url(" .addHeader("X-API-KEY", "YOUR_API_KEY") .post(requestBody) .build(); Response response = okHttpClient.newCall(request).execute(); JSONObject jsonObject = new JSONObject(response.body().string()); int status = jsonObject.optInt("status"); if (status != 200) { throw new Exception(jsonObject.optString("message")); } return jsonObject.getJSONObject("data").optString("task_id");}private static String pollingTaskResult(String taskId, int pollingTime) throws Exception { if (pollingTime >= 30) throw new IllegalStateException("Polling result timeout."); OkHttpClient okHttpClient = new OkHttpClient.Builder().build(); Request taskRequest = new Request.Builder() .url(" + taskId) .addHeader("X-API-KEY", "YOUR_API_KEY") .get() .build(); Response taskResponse = okHttpClient.newCall(taskRequest).execute(); JSONObject jsonObject = new JSONObject(taskResponse.body().string()); int state = jsonObject.getJSONObject("data").optInt("state"); if (state 0) { // Error. throw new Exception(jsonObject.optString("message")); } if (state == 1) { // Success and get result. return jsonObject.getJSONObject("data").toString(); } Thread.sleep(1000); return pollingTaskResult(taskId, ++pollingTime);}const request = require("request");const fs = require("fs");const path = require('path')const API_KEY = "YOUR_API_KEY";(async function main() { const taskId = await createTask() const result = await polling(() => getTaskResult(taskId)) console.log(`result: ${JSON.stringify(result, null, 2)}`)})()const polling = async (fn, delay = 1 * 1000, timeout = 30 * 1000) => { if (!fn) { throw new Error('fn is required') } try
2025-04-11