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
Copy file name to clipboardExpand all lines: docs/usage.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -380,6 +380,31 @@ public async IAsyncEnumerable<SearchResponse> SearchStream(
380
380
381
381
The main limitation of this function is that it expects each JSON object to be returned as a single line. It is unable to parse the response by combining multiple lines into a JSON string.
382
382
383
+
### Uploading files
384
+
385
+
To add a file to the request you can use the `RestRequest` function called `AddFile`. The main function accepts the `FileParameter` argument:
386
+
387
+
```csharp
388
+
request.AddFile(fileParameter);
389
+
```
390
+
391
+
You can instantiate the file parameter using `FileParameter.Create` that accepts a bytes array, or `FileParameter.FromFile`, which will load the file from disk.
392
+
393
+
There are also extension functions that wrap the creation of `FileParameter` inside:
0 commit comments