You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is post parameters in request.postParams data structure
▿ 1 element
▿ 0 : 2 elements
- .0 : "{\"pwd\":\"666666\",\"email\":\"[email protected]\"}"
- .1 : ""
why I can't get post parameters by this method
public extension HTTPRequest {
/// Returns the first GET or POST parameter with the given name.
/// Returns the supplied default value if the parameter was not found.
public func param(name: String, defaultValue: String? = nil) -> String? {
for p in self.queryParams
where p.0 == name {
return p.1
}
for p in self.postParams
where p.0 == name {
return p.1
}
return defaultValue
}
}
Maybe I prefer ask you why design like this?
The text was updated successfully, but these errors were encountered:
ListenXunInNight
changed the title
How to get post parameters by request.param(name: "xxxx")
Can't get post parameters by request.param(name: "xxxx")
Jan 3, 2019
Here is my code
Here is my request
Here is post parameters in request.postParams data structure
why I can't get post parameters by this method
Maybe I prefer ask you why design like this?
The text was updated successfully, but these errors were encountered: