About HttpClient (gb.net.curl) Head method
Posted
#1
(In Topic #960)
Trainee

Code
Dim client As New HttpClient
Dim url As String = "https://mysite/validate.json"
Dim headers As String[]
headers.Add("accept: application/json")
headers.Add("key: " & Me.Key)
client.Async = False
client.Timeout = 20
client.Encoding = "utf-8"
client.URL = url
client.UserAgent = Me.CustomUA
client.Debug = True
client.Head(headers) '-> Error in this line. Cannot load class 'String[]] : Out of bounds
client.GetEven if I use:
Code
client.Head(["accept: application/json","key: " & Me.key])Still get the same error.
Posted
Banned
either use…
Dim headers As New String[]
or
Dim headers As String[] = []
You must do that before you can directly use headers.Add() method.
Posted
Trainee

Code
Dim client As New HttpClient
Dim url As String = "https://mysite/validate.json"
Dim string As String
Dim headers As New String[]
headers.Add("accept: application/json")
headers.Add("key: " & Me.Key)
'Made a loop to show all the values from the Array, works fine
For Each string In headers
Print string
Next
client.Async = False
client.Timeout = 20
client.Encoding = "utf-8"
client.URL = url
client.UserAgent = Me.CustomUA
client.Debug = True
client.Head(headers) '-> Same error. Cannot load class 'String[]] : Out of bounds
client.Get
And im the local variable show this
Posted
Trainee

Code
client.Get(headers)
1 guest and 0 members have just viewed this.






