URLConnection curl

Can a request like this
curl -X GET --header “Accept: application/json” --header “user-key: xxxxx” “https://myapi.com/searchparameter/
be done with URLConnection in a web app?

Something like this should work:

Dim u As New URLConnection
u.RequestHeader("Accept") = "application/json"
u.RequestHeader("user-key") = "xxxxxx"
u.Send("GET", "https://myapi.com/searchparameter/")

Thanks. I will try