Unable to use ServerName when using withCredentials: true?


#1

I do a login call to my server and use withCredentials: true in the call options
If i then do this.http.post(http://<serverName> + urlEnding, body, options).map(res => res.json()) i get a 401 unauth error, but if i do this.http.post(http://<ip> + urlEnding, body, options).map(res => res.json()), it works fine
Is there any reason why this would be an issue in nativescript? Or is it a server issue?

Nativescript: 3.3.0
Tns-core: 3.3.0
Angular: 4.4.6

–EDIT–
Something to point out is that a server name doesnt work but a fully qualified name does, EG serverName.topDomain.local


#2

did you try
http[s]://<ip> instead of just ip?


#3

our certs arent working atm, we’re just testing http


#4

so that’ll be http://<ip>


#5

yeah, thats what i put in the question


#6

In the question you have written just <ip> without a protocol


#7

my bad, i missed it out. I edited it in


#8

Does your server run on any specific port other than port 80?


#9

we dont use port 80, and its just an api for data, not a website