-
Edited by Phongphan Phienphanich
Example of cURL command
curl -X POST \ https://beta.api.biomed.ml/dr/v1/processing \ -H 'Cache-Control: no-cache' \ -H 'X-API-KEY: TU-3BB-hawG6vO2rNORQ9AEtsRQpgif5fdUSEmsOpSMZ8a' \ -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \ -F fundusimg=@/Volumes/pong/tests/practice_images/pdr.jpg -
Edited by Phongphan Phienphanich
Example of PHP Code
<?php $request = new HttpRequest(); $request->setUrl('https://beta.api.biomed.ml/dr/v1/processing'); $request->setMethod(HTTP_METH_POST); $request->setHeaders(array( 'Cache-Control' => 'no-cache', 'X-API-KEY' => 'TU-3BB-hawG6vO2rNORQ9AEtsRQpgif5fdUSEmsOpSMZ8a', 'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' )); $request->setBody('------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="fundusimg"; filename="pdr.jpg" Content-Type: image/jpeg ------WebKitFormBoundary7MA4YWxkTrZu0gW--'); try { $response = $request->send(); echo $response->getBody(); } catch (HttpException $ex) { echo $ex; } -
Edited by Phongphan Phienphanich
Example of Python 3
import requests url = "https://beta.api.biomed.ml/dr/v1/processing" payload = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"fundusimg\"; filename=\"pdr.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--" headers = { 'content-type': "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", 'X-API-KEY': "TU-3BB-hawG6vO2rNORQ9AEtsRQpgif5fdUSEmsOpSMZ8a", 'Cache-Control': "no-cache" } response = requests.request("POST", url, data=payload, headers=headers) print(response.text)
Please register or sign in to comment