http - Swift Alamofire POST request becomes GET -


that's code i'm using make post request flask server in localhost:

func data_request() {     let url:nsurl = nsurl(string: "http://192.168.1.192:9880/api/register")!      alamofire.request(.post, url, parameters: ["login":"login", "password" : "12345"]).responsejson { response in         switch response.result {         case .success:             nslog("validation successful")         case .failure(let error):             nslog("\(error), \(string(data: response.data!, encoding: nsutf8stringencoding))")             return         }         if (response.result.value as? [string: anyobject]) != nil{             print(response.result.value)         }      } } 

but sends request! both server , local proxy tell request - that's burp has intercepted:

get /api/register/ http/1.1 host: 192.168.1.192:9880 accept: */* user-agent: project manager/roman-nikitin.project-manager (1; os x 10.11.3) accept-language: en;q=1.0, fr;q=0.9, de;q=0.8, zh-hans;q=0.7, zh-hant;q=0.6, ja;q=0.5 accept-encoding: gzip;q=1.0, compress;q=0.5 connection: close 

i had same problem, have put / @ end of url. problem in alamofire, think. works weird normal server redirections www.domain.com/something www.domain.com/something/


Comments