Bug Report
FunctionsClient.invoke() creates HTTP requests using method.name, which in Dart returns the lowercase enum value ("post", "get", etc.) instead of the RFC 7230-required uppercase ("POST", "GET").
Affected lines in packages/functions_client/lib/src/functions_client.dart:
- Line 135:
http.MultipartRequest(method.name, uri)
- Line 139:
http.Request(method.name, uri)
Why this matters
This works with IOClient (dart:io) and CupertinoClient (NSURLSession) because they normalize methods to uppercase internally. However, CronetClient from package:cronet_http — the recommended HTTP client for Android — sends the method string verbatim. The Supabase relay then rejects the request with 400 Bad Request.
Reproduction
- Use
CronetClient as httpClient for Supabase (recommended Android setup per cronet_http docs)
- Call
supabase.functions.invoke('my-function', body: {...})
- → 400 Bad Request
- Switch to default
IOClient → works fine
Suggested fix
// Line 135
request = http.MultipartRequest(method.name.toUpperCase(), uri)
// Line 139
final bodyRequest = http.Request(method.name.toUpperCase(), uri);
Bug Report
FunctionsClient.invoke()creates HTTP requests usingmethod.name, which in Dart returns the lowercase enum value ("post","get", etc.) instead of the RFC 7230-required uppercase ("POST","GET").Affected lines in
packages/functions_client/lib/src/functions_client.dart:http.MultipartRequest(method.name, uri)http.Request(method.name, uri)Why this matters
This works with
IOClient(dart:io) andCupertinoClient(NSURLSession) because they normalize methods to uppercase internally. However,CronetClientfrompackage:cronet_http— the recommended HTTP client for Android — sends the method string verbatim. The Supabase relay then rejects the request with 400 Bad Request.Reproduction
CronetClientashttpClientfor Supabase (recommended Android setup percronet_httpdocs)supabase.functions.invoke('my-function', body: {...})IOClient→ works fineSuggested fix