Closed
Description
π Reproduction steps
@override
Future<VideoToken> token({required String room}) async {
try {
final Execution(:responseBody, :responseStatusCode) =
await functions.functions.createExecution(
functionId: functions.videoFunctionId,
method: 'POST',
headers: {
'content-type': 'application/json',
'room': room,
},
xasync: false,
path: '/v1/token',
);
final body = jsonDecode(responseBody) as Map<String, dynamic>;
if (responseStatusCode == 200) {
_logger.info('Token created');
return VideoToken.fromJson(body);
} else {
_logger.severe(
(body['message'] as String?) ?? 'Failed to create token',
);
throw VideoTokenException(
(body['message'] as String?) ?? 'Failed to create token',
StackTrace.current,
);
}
} on AppwriteException catch (e, stackTrace) {
_logger.severe(e.message, e, stackTrace);
throw VideoTokenException(e.message ?? 'Failed to get token', stackTrace);
} catch (e, stackTrace) {
_logger.severe(e, e, stackTrace);
throw VideoTokenException(e.toString(), stackTrace);
}
}
As you can see there is no body pass in the parameter of createExecution
, if I run this this is the error:
π Expected behavior
It should execute the function without body
π Actual Behavior
It gives me Invalid JSON, but If I pas a value on body parameter it execute successfully
π² Appwrite version
Appwrite Cloud
π» Operating system
Windows
π§± Your Environment
No response
π Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
π’ Have you read the Code of Conduct?
- I have read the Code of Conduct