Closed digiAlchem closed 4 years ago
Able to repro, looks like it might be because we need to manually set the form-data headers, but bent doesn't let us in the request function. I'll look into PR-ing this functionality to bent.
@Ovyerus Looks like the form-data
module has a built-in function to get the required headers for sending multipart/form-data
requests.
By moving the const declaration to below the form builder, you can pull those headers out and add them to the bent
constructor.
Am still going to PR this functionality to bent as I need it elsewhere, but I think it's also probably better to make the request function as soon as possible so I'll put it back in the initial constructor.
Please describe the problem you are having in as much detail as possible:
Getting the above error when trying to do a search with an image URL; happens with both
await
and.then()
syntax (I use the latter). Runningconsole.log(sagiriClient)
confirms that it's a loaded function.Enabling
DEBUG=sagiri
returns the following output before the error shows:Include a reproducible code sample here, if possible:
Running
console.log(imageUrl)
confirms that the input and output URLs match.Further details: