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

4

1 回答 1

1

我自己解决了。我创建了一个名为 CustomHTTPSocket 的 HTTPSocket 子类,并使用我的登录名实现了 AuthenticationRequired 事件:

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

现在它可以工作了:)

于 2017-04-25T07:47:12.753 回答