Closed hmuronaka closed 6 years ago
Thanks @hmuronaka, I'll look into this. To help me reproduce, can you post the code you are using to build the URL.
Please try below queryParameters for reproduce.
salesforce.apex(method: .get, path:path, queryParameters:["date": "2018-01-18T00:55:32.000+0000"])
`
Please refer my pullrequest #59 for update.
Thanks @hmuronaka - resolved with version 6.0.3
@hmuronaka FYI you can use the DateFormatter
extension in Swiftly Salesforce to format dates for Salesforce:
public static let salesforceDateTimeFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZ"
return formatter
}()
["date": "2018-01-18T00:55:32.000+0000"] is one of example. I think escaping is necessary also in cases like ["keyword": "abc + def"] and so on...
Anyway thank you your information and for merging my pullrequest!
@hmuronaka indeed. I just meant you could, instead of writing out the date as a string, use:
DateFormatter.salesforceDateTimeFormatter.string(from: myDateValue)
Thank you for the pull request.
When I include a “+” in the url query parameter in the salesforce.apex(:method:.get, path,path, queryParameters:) mothod, it seems to be replaced by a space on the server.
When SwiftlySalesforce was in version Alamofire, I could use the “+” character was replaced with the correct value of “%2B” without any problems. Now it is replaced with ” “.
What is the correct way to build my query parameter that includes the “+” character?
https://stackoverflow.com/questions/43052657/encode-using-urlcomponents-in-swift