Ionicv1 iOS devices sends HEAD request instead of POST

I am running an ionic v1 app with a simple login screen that takes username and password and does a POST to a remote API over HTTP. On a successful login, the user goes to the home screen in the app.

When I deploy the app on any android device, it works just fine. But when I deploy the same app on any ios device, clicking on the sign in button does nothing. When I check the xcode logs it shows

    IC TCP Conn Failed [3:0x600000173e00]: 1:60 Err(60)
    2018-09-13 02:16:07.004607+0530 MyApp[15053:1613654] Task <5E324292-7D81-481B-B905-2522BC11A23E>.<0> HTTP load failed (error code: -1001 [1:60])
    2018-09-13 02:16:07.005251+0530 MyApp [15053:1612177] NSURLConnection finished with error - code -1001

NSLURLConnection error 1001 refers to a timeout. So I checked the web server logs to validate the requests ever made it to the API.
I see that the requests reach the server. The server logs show from all ios devices the login requests are generating a HEAD request instead of a POST. This makes the web server return an HTML page to the request which the app cannot process further because it’s expecting a JSON response.

Web Server Logs for when signing in from any ios device

    [root@ip-10-0-0-151 log]# cat production.log 
    I, [2018-09-12T20:38:35.976774 #12603]  INFO -- : Started HEAD "/users/sign_in" for at 2018-09-12 20:38:35 +0000
    I, [2018-09-12T20:38:35.977758 #12603]  INFO -- : Processing by Devise::SessionsController#new as HTML
    I, [2018-09-12T20:38:35.979483 #12603]  INFO -- :   Rendering devise/sessions/new.html.erb within layouts/login
    I, [2018-09-12T20:38:35.981128 #12603]  INFO -- :   Rendered devise/shared/_links.html.erb (0.3ms)
    I, [2018-09-12T20:38:35.981456 #12603]  INFO -- :   Rendered devise/sessions/new.html.erb within layouts/login (1.9ms)
    I, [2018-09-12T20:38:35.981987 #12603]  INFO -- : Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.0ms)

Web Server Logs when signing in from any android device. This WORKS and in the app user gets to the home screen. That shows API works correctly. Notice the difference in the first request (HEAD) from ios devices and (POST) from android devices.

    [root@ip-10-0-0-151 log]# cat production.log 
    I, [2018-09-12T20:39:25.064640 #12603]  INFO -- : Started POST "/api/users/sign_in" for at 2018-09-12 20:39:25 +0000
    I, [2018-09-12T20:39:25.065825 #12603]  INFO -- : Processing by Api::SessionsController#create as HTML
    I, [2018-09-12T20:39:25.065903 #12603]  INFO -- :   Parameters: {"user"=>{"email"=>"", "password"=>"[FILTERED]"}, "request_type"=>"json", "session"=>{"user"=>{"email"=>"", "password"=>"[FILTERED]"}, "request_type"=>"json"}}

The ionic js code

    	$scope.login = function() {
    			method: 'POST',
    	            'Content-Type': 'application/json',
    			url: config.apiUrl+"users/sign_in",
    			data: {user: {email: $, password: $}, request_type: 'json' }
    		}).then(function successCallback(response) {
    }, function(err) {
    				alert('code: '    + err.code    + '\n' +
    					'message: ' + err.message + '\n');
    			}, function errorCallback(response) {
    			    // called asynchronously if an error occurs
    			    // or server returns response with an error status.
    			    	title: 'Problem with authentication',
    			    	template: '<div style="text-align:center">''</div>',

So, my trouble is if the code is cross-platform and works correctly for android devices, why is ios generating a different behaviour ? What could be the possible cause for this ?