Last active
July 15, 2022 17:15
Mailchimp Integration Using VB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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