File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public actor FunctionsClient {
9191 let url = self . url. appendingPathComponent ( functionName)
9292 var urlRequest = URLRequest ( url: url)
9393 urlRequest. allHTTPHeaderFields = invokeOptions. headers. merging ( headers) { first, _ in first }
94- urlRequest. httpMethod = invokeOptions. method? . rawValue ?? " POST
94+ urlRequest. httpMethod = ( invokeOptions. method ?? . post ) . rawValue
9595 urlRequest. httpBody = invokeOptions. body
9696
9797 let ( data, response) = try await fetch ( urlRequest)
Original file line number Diff line number Diff line change @@ -20,15 +20,17 @@ public enum FunctionsError: Error, LocalizedError {
2020
2121/// Options for invoking a function.
2222public struct FunctionInvokeOptions {
23+ /// Method to use in the function invocation.
2324 let method : Method ?
2425 /// Headers to be included in the function invocation.
2526 let headers : [ String : String ]
2627 /// Body data to be sent with the function invocation.
2728 let body : Data ?
2829
2930 /// Initializes the `FunctionInvokeOptions` structure.
30- ///
31+ ///
3132 /// - Parameters:
33+ /// - method: Method to use in the function invocation.
3234 /// - headers: Headers to be included in the function invocation. (Default: empty dictionary)
3335 /// - body: The body data to be sent with the function invocation. (Default: nil)
3436 public init ( method: Method ? = nil , headers: [ String : String ] = [ : ] , body: some Encodable ) {
@@ -53,7 +55,9 @@ public struct FunctionInvokeOptions {
5355
5456 /// Initializes the `FunctionInvokeOptions` structure.
5557 ///
56- /// - Parameter headers: Headers to be included in the function invocation. (Default: empty dictionary)
58+ /// - Parameters:
59+ /// - method: Method to use in the function invocation.
60+ /// - headers: Headers to be included in the function invocation. (Default: empty dictionary)
5761 public init ( method: Method ? = nil , headers: [ String : String ] = [ : ] ) {
5862 self . method = method
5963 self . headers = headers
You can’t perform that action at this time.
0 commit comments