How to write CURL under vb 10

@ECHO OFF

curl -v -X GET "https://mydata-dev.azure-api.net/RequestInvoices?mark={string}&nextPartitionKey={string}&nextRowKey={string}"
-H "aade-user-id: "
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}"

How to write this under Visual Basic 2010 ?

Upvotes: 0

Views: 130

Answers (1)

InteXX
InteXX

Reputation: 6367

Welcome to SO!

As @AndrewMorton indicated, you might consider using the .NET Azure API instead. If that's not an option, however, you can use the WebClient class to do this.

Imports System.Net

Friend Module Main
  Public Sub Main()
    Dim sResponse as String

    Using oRequest As New WebClient
      oRequest.QueryString.Add("mark", "{String}")
      oRequest.QueryString.Add("nextPartitionKey", "{String}")
      oRequest.QueryString.Add("nextRowKey", "{String}")

      oRequest.Headers.Remove("aade-user-id")
      oRequest.Headers.Add("Ocp-Apim - Subscription - Key", "{subscription key}")

      sResponse = oRequest.DownloadString("https://mydata-dev.azure-api.net/RequestInvoices")
    End Using
  End Sub
End Module

Upvotes: 1

Related Questions