Search code examples
iosswiftgetsthttprequest

STHTTPRequest returning null


I'm able to load this URL in a safari browser and see the JSON data I need, but this STHTTPRequest is returning null, making me not able to use the JSON, what is going wrong here? I am loading in safari

let url = "192.168.101.1:8080/api"
let request = STHTTPRequest.buildGET(URL(string: url), timeout: 15.0)!

Solution

  • needed to add http:// to the beginning of the url, giving http://192.168.101.1:8080/api/status