Closed haoxiaogang0919 closed 3 years ago
Hi @Wulaowu. Here's a solution:
form-data
package if you are making this request from node.
let formData = new FormData();
formData.append("listing_id", "<listing_id>");
formData.append("image", fs.createReadStream("<path_to_image>"));
let image = (await client.ListingImage.uploadListingImage
*Unfortunately, we have to cast parameters `as any`, therefore losing strong typing advantages.
This can be considered in the API wrapper, but I say let's wait for API v3 and see if it's' worth the effort.*
Make sure you provide both correct listing_id
and path_to_image
. I've put placeholders for those values in the above code.
Already, I forgot to upload listing_id just now. I am waiting for v3 to appear
"Content-Type":"multipart/form-data"