{"action":"opened","issue":{"url":"https://api.github.com/repos/Alamofire/Alamofire/issues/995","labels_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/995/labels{/name}","comments_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/995/comments","events_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/995/events","html_url":"https://github.com/Alamofire/Alamofire/issues/995","id":125247744,"number":995,"title":"POST requests using Alamofire not being recognized by Laravel","user":{"login":"renatop7","id":4468986,"avatar_url":"https://avatars.githubusercontent.com/u/4468986?v=3","gravatar_id":"","url":"https://api.github.com/users/renatop7","html_url":"https://github.com/renatop7","followers_url":"https://api.github.com/users/renatop7/followers","following_url":"https://api.github.com/users/renatop7/following{/other_user}","gists_url":"https://api.github.com/users/renatop7/gists{/gist_id}","starred_url":"https://api.github.com/users/renatop7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renatop7/subscriptions","organizations_url":"https://api.github.com/users/renatop7/orgs","repos_url":"https://api.github.com/users/renatop7/repos","events_url":"https://api.github.com/users/renatop7/events{/privacy}","received_events_url":"https://api.github.com/users/renatop7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-06T19:43:07Z","updated_at":"2016-01-06T19:43:07Z","closed_at":null,"body":"Hey everyone,\r\n\r\nI'm using Laravel 5.2 to develop my API and Alamofire to make my HTTP requests in my iOS app.\r\n\r\nWhen I try to make a GET, PUT, DELETE request I receive a proper response.\r\nBut when I try to make a POST request it arrives in my web service as a GET request, so I get a GET response.\r\n\r\nI tried to use an app from the AppStore to make HTTP Requests to my API and received a good POST response. Also using Postman I receive a good POST response.\r\n\r\nI really don't know what the problem is since I've debugged everything. And I came to the conclusion that my app is not making a proper POST request for Laravel with Alamofire.\r\n\r\nHere is my code, I've developed a Route Builder:\r\n\r\n```\r\nimport Foundation\r\nimport Alamofire\r\n\r\n\r\nenum UserRouter: URLRequestConvertible{\r\n    \r\n    static let baseURL = NSURL(string: \"http://192.168.0.106/regions\")!\r\n    \r\n    case Users\r\n    case CreateUser([String: AnyObject])\r\n    case ReadUser(Int)\r\n    case UpdateUser(Int, [String: AnyObject])\r\n    case DestroyUser(Int)\r\n    \r\n    var URL: NSURL { return UserRouter.baseURL.URLByAppendingPathComponent(route.path) }\r\n    \r\n    var route: (path: String, parameters: [String: AnyObject]?) {\r\n        \r\n        switch self{\r\n        \r\n        case .Users:\r\n            return (\"/\", nil)\r\n        case .ReadUser(let userID):\r\n            return (\"/\\(userID)\", nil)\r\n        case .CreateUser(let userInfo):\r\n            return (\"/\", userInfo)\r\n        case .UpdateUser(let userID, let userInfo):\r\n            return (\"/\\(userID)\", userInfo)\r\n        case .DestroyUser(let userID):\r\n            return (\"/\\(userID)\", nil)\r\n        }\r\n        \r\n    }\r\n    \r\n    var method: Alamofire.Method{\r\n        \r\n        switch self{\r\n            \r\n        case .Users:\r\n            return .GET\r\n        case .ReadUser:\r\n            return .GET\r\n        case .CreateUser:\r\n            return .POST\r\n        case .UpdateUser:\r\n            return .PUT\r\n        case .DestroyUser:\r\n            return .DELETE\r\n            \r\n        }\r\n        \r\n    }\r\n    \r\n    var URLRequest: NSMutableURLRequest {\r\n        \r\n        let httpRequest = NSMutableURLRequest(URL: URL)\r\n        httpRequest.HTTPMethod = \"POST\"\r\n        \r\n        switch self{\r\n            \r\n        case .CreateUser (let userInfo):\r\n            return Alamofire.ParameterEncoding.URL.encode(httpRequest, parameters: userInfo).0\r\n        default:\r\n            return Alamofire.ParameterEncoding.URL.encode(httpRequest, parameters: (route.parameters ?? [ : ])).0\r\n            \r\n        }\r\n        \r\n    }\r\n    \r\n}\r\n\r\n//Testing the Route Builder\r\nfunc testRoute(){\r\n    \r\n    print(Alamofire.request(UserRouter.CreateUser([\"name\":\"test\"]))) //Output: POST http://192.168.0.106/users/\r\n    \r\n    Alamofire.request(UserRouter.CreateUser([\"name\":\"test\"])).responseJSON{ (response) in\r\n        \r\n        switch response.result{\r\n            \r\n        case .Success(let data):\r\n            print (data) //Output: My GET response :(\r\n        case .Failure:\r\n            print(\"fail\")\r\n        }\r\n        \r\n    }\r\n    \r\n}\r\n\r\n```\r\n"}}