当我调用 DELETE 时,我得到“找不到邮件列表成员”,然后我测试了一个 PUT,以尝试更新订阅设置,我得到了相同的消息。
但是,当我尝试将带有 POST 的人添加到具有相同电子邮件地址的列表中时,我会收到“地址已存在”消息....使用相同的 API 和结构:
Public Function RemoveMember(ListEmail As String, EmailAddress As String) As RestResponse
Dim client As New RestClient()
client.BaseUrl = "https://api.mailgun.net/v2"
client.Authenticator = New HttpBasicAuthenticator("api", MailGunAPI)
Dim request As New RestRequest()
request.Resource = "lists/{list}/members/{member}"
request.AddParameter("list", ListEmail, ParameterType.UrlSegment)
request.AddParameter("member", EmailAddress)
request.Method = Method.DELETE
Return client.Execute(request)
End Function