Skip to content

Commit

Permalink
chore: note about react native
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed May 5, 2024
1 parent a5661ef commit 1231753
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,18 @@ await tuyau.users.$post({ avatar: file })

As soon as you pass a `File` instance in the request, Tuyau will automatically convert it to a `FormData` instance and set the correct headers for you. The payload will be serialized using the [`object-to-formdata`](https://www.npmjs.com/package/object-to-formdata) package.

Note that if you are using React Native, you should pass your file as follows :

```ts
await tuyau.users.$post({
avatar: {
uri: 'file://path/to/file',
type: 'image/jpeg',
name: 'avatar.jpg'
}
})
```

#### Responses

For every request, Tuyau will return a promise with the following types :
Expand Down

0 comments on commit 1231753

Please sign in to comment.