Skip to content

Instantly share code, notes, and snippets.

@harikrishna43
Last active July 15, 2022 17:15
Show Gist options
  • Save harikrishna43/7efa0df1ed394ec3f6d688554d0de9a4 to your computer and use it in GitHub Desktop.
Save harikrishna43/7efa0df1ed394ec3f6d688554d0de9a4 to your computer and use it in GitHub Desktop.
Mailchimp Integration Using VB
Imports System
Imports System.Net.Http
Imports System.Net.Http.Headers
Module Program
Sub Main(args As String())
Dim page As String = "https://{server}.api.mailchimp.com/3.0/ping"
Using client As HttpClient = New HttpClient()
client.DefaultRequestHeaders.Authorization = New System.Net.Http.Headers.AuthenticationHeaderValue("Basic", "{APIKEY}")
client.DefaultRequestHeaders.Accept.Add(New System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"))
Using response As HttpResponseMessage = client.GetAsync(page).Result
Using content As HttpContent = response.Content
Dim result As String = content.ReadAsStringAsync().Result
Console.WriteLine(result)
End Using
End Using
End Using
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment