URLConnection not allowing access to ContentReceived?

I am trying the following code:
image
and am not understanding why I get the error that There is more than one method with this name but this does not match any of the available signatures.

I cannot use a While / Wend block to scan for updates to ContentReceived. :thinking:

I am trying to understand this. Thanks for any help!

*The line of text ends with a quote marks and a closed-parentheses.

A time-out parameter is required with that call. Are you including that?

There is an example project that demonstrates various usage of URLConnection in the Communication/Internet folder.

1 Like

Yeah, I am using the following code and get a NilObjectException:

Var PriceDOGE As URLConnection
Var as1 As String = "https://block.io/api/v2/get_current_price/?api_key=KEY"
TextArea1.Text=PriceDOGE.SendSync("GET", as1, 300)

I do not know where I am going wrong.

That should be New URLConnection

1 Like

Tried that, I’ll try it again.

This code actually works:

Var PriceDOGE As New URLConnection
Var ff1 As FolderItem
ff1 = App.ExecutableFile.Parent
ff1 = ff1.Child("result.json")
Var as1 As String = "https://block.io/api/v2/get_current_price/?api_key=KEY"
PriceDOGE.SendSync("GET", as1, ff1, 30)

But for some reason, exporting to textarea does not YET work.

OK, I hacked around and figured it out just trying different combos of stuff.

Var PriceDOGE As New URLConnection
Var as1 As String = "https://block.io/api/v2/get_current_price/?api_key=KEY"
TextArea1.Text = PriceDOGE.SendSync("GET", as1, 30)

Odd. I thought I had it this way before but hacked it and now works.

Utilizing a receiving control or variable to handle the event is what I was missing out on.

I think I am finally getting to understand how these connections work, maaaaybe.
Thanks for the help.

For EVERYONE on here… this code is part of how you can build and accept crypto payment processing right in your apps.
Y’all are welcome.
[looks for Scrooge McDuck counting the money emoji, can’t find one]