File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public actor FunctionsClient {
91
91
let url = self . url. appendingPathComponent ( functionName)
92
92
var urlRequest = URLRequest ( url: url)
93
93
urlRequest. allHTTPHeaderFields = invokeOptions. headers. merging ( headers) { first, _ in first }
94
- urlRequest. httpMethod = invokeOptions. method? . rawValue ?? " POST
94
+ urlRequest. httpMethod = ( invokeOptions. method ?? . post ) . rawValue
95
95
urlRequest. httpBody = invokeOptions. body
96
96
97
97
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 {
20
20
21
21
/// Options for invoking a function.
22
22
public struct FunctionInvokeOptions {
23
+ /// Method to use in the function invocation.
23
24
let method : Method ?
24
25
/// Headers to be included in the function invocation.
25
26
let headers : [ String : String ]
26
27
/// Body data to be sent with the function invocation.
27
28
let body : Data ?
28
29
29
30
/// Initializes the `FunctionInvokeOptions` structure.
30
- ///
31
+ ///
31
32
/// - Parameters:
33
+ /// - method: Method to use in the function invocation.
32
34
/// - headers: Headers to be included in the function invocation. (Default: empty dictionary)
33
35
/// - body: The body data to be sent with the function invocation. (Default: nil)
34
36
public init ( method: Method ? = nil , headers: [ String : String ] = [ : ] , body: some Encodable ) {
@@ -53,7 +55,9 @@ public struct FunctionInvokeOptions {
53
55
54
56
/// Initializes the `FunctionInvokeOptions` structure.
55
57
///
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)
57
61
public init ( method: Method ? = nil , headers: [ String : String ] = [ : ] ) {
58
62
self . method = method
59
63
self . headers = headers
You can’t perform that action at this time.
0 commit comments