I was able to issue an http delete against a contact id using .NET 2.0 Framework. This code was initially written in C#.NET which I then ran through the .net code converter.
Dim apiKey As [String] = "APIKEY"
Dim username As [String] = "USERNAME"
Dim password As [String] = "PASSWORD"
Dim contactId As [String] = "https://api.constantcontact.com/ws/customers/" & username & "/contacts/1"
Dim credentials As New NetworkCredential(apiKey & "%" & username, password)
Dim ctctRequest As WebRequest = WebRequest.Create(contactId)
ctctRequest.Method = "DELETE"
ctctRequest.Credentials = credentials
Dim ctctResponse As HttpWebResponse = TryCast(ctctRequest.GetResponse(), HttpWebResponse)
Dim responseStream As New StreamReader(ctctResponse.GetResponseStream())
Dim responseText As String = responseStream.ReadToEnd()
Dim responseCode As Integer = CInt(ctctResponse.StatusCode)
ctctResponse.Close()
responseStream.Close()
MessageBox.Show(responseCode & responseText)
Please note that you need to insert your username, password, and apiKey in order for this to work. Also, this is currently set to delete contact "1" and you would want to adjust this to delete the appropriate contact.
I hope this helps. Please let me know if you have any other questions or concerns, or if this does not work for you. Thanks!
... View more