fix: update performLCERequest for LCEssentials 2.0.2 API.request signature
LCEssentials 2.0.2 replaced request(url:params:method:headers:jsonEncoding:debug:) with request(url:method:body:pathParams:headers:debug:timeoutInterval:networkServiceType:persistConnection:). The pre-encoded params Data is now wrapped in RawBody to preserve the same application/json Content-Type behavior that jsonEncoding: true used to set.
This commit is contained in:
@@ -175,12 +175,12 @@ extension ApiClient {
|
|||||||
headers: [String: String]
|
headers: [String: String]
|
||||||
) async throws -> String {
|
) async throws -> String {
|
||||||
let httpMethod = toHTTPMethod(method)
|
let httpMethod = toHTTPMethod(method)
|
||||||
|
let body: (any HTTPBody)? = params.map { RawBody(data: $0, contentType: "application/json; charset=UTF-8") }
|
||||||
return try await API.shared.request(
|
return try await API.shared.request(
|
||||||
url: url,
|
url: url,
|
||||||
params: params,
|
|
||||||
method: httpMethod,
|
method: httpMethod,
|
||||||
|
body: body,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
jsonEncoding: true,
|
|
||||||
debug: true
|
debug: true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user