HttpEngine class
The resilient REST engine used by every sub-client.
Constructors
- HttpEngine({required DeepgramConfig config, required DeepgramAuth auth, Client? client})
-
Creates an engine bound to
config, obtaining credentials fromauth.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void - Closes the underlying HTTP client.
-
deleteJson(
String path, {Object? body, Map< String, dynamic> ? query, Map<String, String> ? headers, HttpCancelToken? cancelToken}) → Future<JsonApiResult> - Performs a DELETE and decodes a JSON object response (may be empty).
-
getJson(
String path, {Map< String, dynamic> ? query, Map<String, String> ? headers, HttpCancelToken? cancelToken}) → Future<JsonApiResult> - Performs a GET and decodes a JSON object response.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patchJson(
String path, {Object? body, Map< String, dynamic> ? query, Map<String, String> ? headers, HttpCancelToken? cancelToken}) → Future<JsonApiResult> - Performs a PATCH with a JSON body and decodes a JSON object response.
-
postAudio(
String path, {required List< int> audio, required String contentType, Map<String, dynamic> ? query, Map<String, String> ? headers, HttpCancelToken? cancelToken}) → Future<JsonApiResult> - Uploads raw audio/video bytes to a JSON endpoint (e.g. pre-recorded transcription) and decodes the response.
-
postForBytes(
String path, {Object? body, Map< String, dynamic> ? query, Map<String, String> ? headers, HttpCancelToken? cancelToken}) → Future<List< int> > -
POSTs to an endpoint that streams raw audio bytes back (e.g.
/v1/speak) and returns the collected bytes. -
postForByteStream(
String path, {Object? body, Map< String, dynamic> ? query, Map<String, String> ? headers, HttpCancelToken? cancelToken}) → Future<Stream< List< >int> > - POSTs to an endpoint that streams raw audio bytes back and returns the response body as a byte stream — use for playback-as-you-download.
-
postJson(
String path, {Object? body, Map< String, dynamic> ? query, Map<String, String> ? headers, HttpCancelToken? cancelToken}) → Future<JsonApiResult> - Performs a POST with a JSON body and decodes a JSON object response.
-
putJson(
String path, {Object? body, Map< String, dynamic> ? query, Map<String, String> ? headers, HttpCancelToken? cancelToken}) → Future<JsonApiResult> - Performs a PUT with a JSON body and decodes a JSON object response.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited