Skip to content

Commit 9b5bf67

Browse files
committed
Fix after rebase
1 parent 1a4d03a commit 9b5bf67

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Sources/Functions/FunctionsClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)

Sources/Functions/Types.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ public enum FunctionsError: Error, LocalizedError {
2020

2121
/// Options for invoking a function.
2222
public 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

0 commit comments

Comments
 (0)