Cloud Run
callContainer
Future<CloudRunResponse> app.callContainer({
required String name,
HttpMethod method = HttpMethod.get,
String path = '/',
Map<String, String>? header,
Map<String, dynamic>? data,
})
Call cloud run container service. Supports custom HTTP method, path, and headers.
Parameters
name
String
Cloud run service name
method
HttpMethod
HTTP request method (default GET)
path
String
HTTP request path (default /)
header
Map<String, String>?
HTTP request headers
data
Map<String, dynamic>?
HTTP request body
Response
Future
CloudRunResponse
Example
- Example
final result = await app.callContainer(
name: 'my-service',
method: HttpMethod.post,
path: '/api/data',
data: {'key': 'value'},
header: {'X-Custom': 'header'},
);
if (result.isSuccess) {
print('Response data: ${result.result}');
} else {
print('Request failed: ${result.message}');
}