Pinata.Client
Pinata.Client copied to clipboard
Throw exception on passing MultipartFormDataContent in AddPinataFile
Context
Hi, thanks for your Pinata client first of all.
I needed to upload a directory with files. In PinFileToIpfsAsync
I've passed Action
in which I've called AddPinataFile
only once and passed MultipartFormDataContent
object in it. Since MultipartFormDataContent
is a heir of HttpContent
code worked correctly, but when I opened Pinata I saw, that I've uploaded a file without extension.
I was puzzled until I opened your source code and after that I've replaced one call of AddPinataFile
passing MultipartFormDataContent
with foreach and passing ByteArrayContent
.
It is not intended to use MultipartFormDataContent
in AddPinataFile
, so maybe it should be prevented?
Alternatives
Throw ArgumentException
when user passes MultipartFormDataContent
object in AddPinataFile
.
If the feature request is approved, would you be willing to submit a PR?
Yes