daltoniam / SwiftHTTP

Thin wrapper around NSURLSession in swift. Simplifies HTTP requests.
Apache License 2.0
1.88k stars 313 forks source link

post can't pass paramters php server success #284

Closed gaoml0904 closed 6 years ago

gaoml0904 commented 6 years ago

''' let paramsEn = ["en":"params"] HTTP.POST(serviceURL, parameters: paramsEn, headers: nil, requestSerializer: JSONParameterSerializer(), completionHandler: { (response) in }) ''' I use above code to post. the server side with php can't receive the parameters.who can help

daltoniam commented 6 years ago

If your server isn't receiving the HTTP request you made, I would check to ensure your serviceURL is correct and that your device has a connection to reach the server. You should get an error if the request fails telling you what the issue is. Those are my recommendations based on the information provided, but this is probably an environment issue rather than an issue with the library.

sotoudegan commented 6 years ago

Hi I have same problem. I have request with json parameters as html body, Server received my http request, but it coudln't get the parameters