2

I'm new to XOJO and I'm making a Web App to list the time entries of my co-workers.

The Code looks like this:

Dim Socket as new HTTPSocket
Dim d As New Dictionary
Dim result As String

Socket.SetRequestContent("","application/json; charset=utf-8")
result = Socket.get("http://teamwork.companyname.com/time/total.json?userId=111111", 30) 
result = DefineEncoding(result, Encodings.UTF8)

OutputArea3.Text = result

When I replace the URL with www.example.com, it works and the content can be loaded. I also tried it with various URL's for different JSON's from the Web, but it didn't work too.

What should I use, so that JSON's can be loaded?

Many Thanks for your advice

Richi
  • 31
  • 8
  • May I suggest to post a slightly shorter JSON example? To answer your question, that long text is not needed and only clutters the question – Thomas Tempelmann Apr 12 '17 at 12:56
  • Do you want to load the JSON data server- oder client-side? I guess server-side? Then why not use a HTTPSocket subclass to load it, then create a JSONItem from the text you get in the PageReceived event? Have you tried it? Or do you need help with that? – Thomas Tempelmann Apr 12 '17 at 12:59

1 Answers1

1

I solved it by myself. I made a Subclass of HTTPSocket called CustomHTTPSocket and implemented the AuthenticationRequired Event with my login:

name="username"
password="password"
return true

Now it works :)

Richi
  • 31
  • 8