Sign In Register

How can we help you today?

Start a new topic
Answered

Https requests with SparkHttp ?

The name of the class and all of the examples use "http", so I wanted to make sure "https" requests are supported and work securely (i.e. don't switch to "http" under the hood).


Thanks


Best Answer

Hey Baris,


When using the getHttp() method, the value is retained, and never converted. Therefore any Https requests you make will remain secure and the url unaltered.

Hope this helps.

- Tony


Yes it does.  I just tried:

 

var response = Spark.getHttp("https://www.google.com").get().getResponseString();
Spark.setScriptData("Random String", response);

 and it returned google's https home page.

And google.com http requests get forwarded to https - so, yeah - it's not switching to http under the hood as I woudlnt' have gotten results otherwise.

Thanks Jeff! You're probably right, but Google could still default to http if the client doesn't support https at all, so an official word would be nice.


(for instance, apparently, if you add ?nord=1 at the end of the url, it doesn't switch to https. So something similar could happen if the client doesn't support https)

Baris - fair enough - and I'm sure GameSparks will weigh in soon enough.

(although I just tested a url that ONLY supports https (I know because I helped developed the system) and things worked as expected)

Thanks Jeff! In that case, and since there is no official answer, it seems safe to assume https works correctly.

Answer

Hey Baris,


When using the getHttp() method, the value is retained, and never converted. Therefore any Https requests you make will remain secure and the url unaltered.

Hope this helps.

- Tony

Great, thanks!

Login to post a comment