I just rank a quick test with your URL, and here's my output URL:
https://domain.com/rest/api/2/search/?assignment=user123%28%29%20order%20by%20lastUpdated%20desc&query=
So as you can see, the query
param has not been skipped, it's just placed at the end. The Alamofire class ParameterEncoding.swift
sorts the keys alphabetically while constructing the URL.
Here's my code for reference:
let endpoint = "https://domain.com/rest/api/2/search/"
let params:[String:AnyObject] = ["query" : "","assignment" : "user123() order by lastUpdated desc"]
Alamofire.request(.GET, endpoint, parameters: params)
.responseData { response in
if let str = response.request?.URLString {
print("~~~URL~~~
", str)
} else {
print("oops")
}
}
However, the main point here is that if your intention is to pass one key (query
) and one value (assignment=user123...
), then the =
is right to be encoded to %20%3D%20
.
Your server should decode this back to a =
and use it as required.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…