### jQuery AJAX for Image Upload Source: https://lingdanqing.github.io/EasyImages2.0.github.io/docs/API.md This jQuery AJAX example demonstrates how to upload an image and token using FormData and an AJAX request. It configures the request for multipart/form-data. ```javascript const form = new FormData(); form.append("token", "8337effca0ddfcd9c5899f3509b23657"); form.append("image", "195124.jpg"); const settings = { "async": true, "crossDomain": true, "url": "https://png.cm/api/index.php", "method": "POST", "headers": {}, "processData": false, "contentType": false, "mimeType": "multipart/form-data", "data": form }; $.ajax(settings).done(function (response) { console.log(response); }); ``` -------------------------------- ### Curl Command for Image Upload Source: https://lingdanqing.github.io/EasyImages2.0.github.io/docs/API.md A curl command to upload an image and token to the API. This is a convenient way to test the API endpoint from the command line. ```curl curl --request POST \ --url https://png.cm/api/index.php \ --header 'content-type: multipart/form-data' \ --form token=8337effca0ddfcd9c5899f3509b23657 \ --form image=@195124.jpg ``` -------------------------------- ### Python Script for Image Upload Source: https://lingdanqing.github.io/EasyImages2.0.github.io/docs/API.md This Python script uses the 'requests' library to send a POST request with image and token data to the API. It demonstrates how to construct the multipart/form-data payload. ```python import requests url = "https://png.cm/api/index.php" payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"token\"\r\n\r\n8337effca0ddfcd9c5899f3509b23657\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\n195124.jpg\r\n-----011000010111000001101001--\r\n\r\n" headers = {"content-type": "multipart/form-data; boundary=---011000010111000001101001"} response = requests.request("POST", url, data=payload, headers=headers) print(response.text) ``` -------------------------------- ### HTML Form for Image Upload Source: https://lingdanqing.github.io/EasyImages2.0.github.io/docs/API.md An HTML form to upload an image and a token to the API. Ensure the 'image' input is used for file selection and 'token' for the authentication token. ```html
``` -------------------------------- ### Successful Upload JSON Response Source: https://lingdanqing.github.io/EasyImages2.0.github.io/docs/API.md This is the JSON response received after a successful image upload. It includes the result, status code, image URL, and other relevant details. ```json { "result":"success","code":200, "url":"https:\/\/i2.100024.xyz\/2023\/01\/24\/10gwv0y-0.webp", "srcName":"195124", "thumb":"https:\/\/png.cm\/application\/thumb.php?img=\/i\/2023\/01\/24\/10gwv0y-0.webp", "del":"https:\/\/png.cm\/application\/del.php?hash=bW8vWG4vcG8yM2pLQzRJUGI0dHlTZkN4L2grVmtwUTFhd1A4czJsbHlMST0=" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.