This plugin could resize(optional) and upload the image in your clipboard to any image hosting automatically when pasting.
Take Imgur as an example. The upload request is something like this:
curl --location --request POST 'https://api.imgur.com/3/image' \
--header 'Authorization: Client-ID {{clientId}}' \
--form 'image="R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'
So, Api Endpoint
should be https://api.imgur.com/3/image
and Upload Header
should be {"Authorization": "Client-ID {{clientId}}"}
.
The response of the upload request is:
{
"data": {
"id": "orunSTu",
"title": null,
"description": null,
"datetime": 1495556889,
"type": "image/gif",
"animated": false,
"width": 1,
"height": 1,
"size": 42,
"views": 0,
"bandwidth": 0,
"vote": null,
"favorite": false,
"nsfw": null,
"section": null,
"account_url": null,
"account_id": 0,
"is_ad": false,
"in_most_viral": false,
"tags": [],
"ad_type": 0,
"ad_url": "",
"in_gallery": false,
"deletehash": "x70po4w7BVvSUzZ",
"name": "",
"link": "http://i.imgur.com/orunSTu.gif"
},
"success": true,
"status": 200
}
All you need is the image url http://i.imgur.com/orunSTu.gif
, so Image Url Path
should be data.link
.
Lsky-Pro is a open-sourced and self-hosted image hosting solution.
Thanks to @xaya1001 for this example.
api endpoint:https://img.domain.com/api/v1/upload
upload header:
{
"Authorization": "Bearer xxxx",
"Accept": "application/json",
"Content-Type": "multipart/form-data"
}
upload body:
{
"file": "$FILE"
}
Image Url Path: data.links.url