You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently react-native-blob-courier supports multipart file uploads only, but there are situations where it is desirable to send a file to the server as a raw HTTP body.
Proposed solution
Add a send(request:SendRequest) method to TypeScript code base, inspired by HttpClient.Send.
Why not use fetch's RequestInit as input? it contains all the fields already and could be extended to add fileURI as a new prop.
Remember headers in the true HTTP protocol sense is not just a dictionary because there could be multiple named headers.
Good catch, and you're absolutely right, however: for the request interfaces I already take inspiration from fetch and fetch does actually treat headers as a dictionary and combines duplicate headers into a comma separated list[1],[2], so I'm sticking with that.
Using RequestInit is a good suggestion as well, but it contains fields that aren't supported by the native code base yet and possibly ever. So that would communicate false expectations to users of the library.
Originally suggested by @pke in #135
Currently
react-native-blob-courier
supports multipart file uploads only, but there are situations where it is desirable to send a file to the server as a raw HTTP body.Proposed solution
Add a
send(request:SendRequest)
method to TypeScript code base, inspired by HttpClient.Send.SendRequest
would look something like:Progress
send(request:SendRequest)
method to TypeScript code basesend(method:string,absolutePath:string,headers:dictionary)
method to Android code basesend(method:string,absolutePath:string,headers:dictionary)
method to iOS code baseThe text was updated successfully, but these errors were encountered: