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: MyApp/_pages/add-servicestack-reference.md
+115Lines changed: 115 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,8 @@ The [x dotnet tool](/dotnet-tool) provides simple command-line utilities to easi
140
140
dotnet tool install --global x
141
141
:::
142
142
143
+
::include npx-get-dtos.md::
144
+
143
145
This will make the following utilities available from your command-line which will let you download the Server DTO classes for a remote ServiceStack endpoint in your chosen language which you can use with ServiceStack's generic Service clients to be able to make end-to-end API calls.
144
146
145
147
<tableclass="table table-bordered">
@@ -390,6 +392,119 @@ in the right-click context menu:
390
392
391
393
If you're updating references frequently you can save time by [assigning it a keyboard shortcut](https://www.jetbrains.com/help/rider/Configuring_Keyboard_and_Mouse_Shortcuts.html).
392
394
395
+
396
+
## Multiple File Upload Support with API Requests supported in all languages
397
+
398
+
To be able to call [AI Server](/ai-server/) APIs requiring file uploads we've added multiple file upload support with API Requests to the generic service clients for all our supported languages.
399
+
400
+
Here's what that looks like for different languages calling AI Server's `SpeechToText` API:
The `postFileWithRequest` method can be used to upload a file with an API Request.
339
+
340
+
### Dart Speech to Text
341
+
342
+
Here's an example calling [AI Server's](/ai-server/) `SpeechToText` API:
343
+
344
+
```dart
345
+
var audioFile = new File('audio.wav');
346
+
var uploadFile = new UploadFile(
347
+
fieldName: 'audio',
348
+
fileName: audioFile.uri.pathSegments.last,
349
+
contentType: 'audio/wav',
350
+
contents: await audioFile.readAsBytes()
351
+
);
352
+
353
+
var response = await client.postFileWithRequest(new SpeechToText(), uploadFile);
354
+
```
355
+
356
+
To upload multiple files use `postFilesWithRequest`.
357
+
358
+
310
359
#### Comprehensive Test Suite
311
360
312
361
To ensure a high quality implementation we've ported the [TypeScript @servicestack/client](https://github.com/ServiceStack/servicestack-client) test suite over to Dart which is itself a good resource for discovering [different supported features and flexible HTTP Request options](https://github.com/ServiceStack/servicestack-dart/tree/master/test) available.
To upload multiple files use `postFilesWithRequest`.
303
+
264
304
### AndroidServiceClient
265
305
Unlike .NET, Java doesn't have an established Async story or any language support that simplifies execution and composition of Async tasks, as a result the Async story on Android is fairly fragmented with multiple options built-in for executing non-blocking tasks on different threads including:
0 commit comments