Got a 'How do I' question? Join 'Ask a Trainer' Monday to Friday, 11am to 4pm ET for instant help and pro tips!

Error: Cannot send a content-body with this verb-type

ChrisC763
Rookie
0 Votes
Hello, I've recently upgraded my VS project from VS2017 to VS2019. Also I've upgraded the dotnet framework version from 4.7.2 to 4.8. After the upgrade my routine to obtain the Authorization Token started throwing an error. Here is the code: Dim sBase64cred As String Dim client = New RestSharp.RestClient("https://authz.constantcontact.com/oauth2/default/v1/token?code=" & gclsSession.CC_API3_oAuth2Token & "&redirect_uri=" & cLocalHost & "&grant_type=authorization_code") Dim request = New RestRequest(Method.Post) Dim credentials As String = consumerKey & ":" & consumerSecret Dim plain As Byte() = System.Text.Encoding.UTF8.GetBytes(credentials) Dim response As RestResponse sBase64cred = Convert.ToBase64String(plain) Dim base64auth = "Basic " & sBase64cred request.AddHeader("content-type", "application/x-www-form-urlencoded") request.AddHeader("scope", "contact_data+offline_access") request.AddHeader("authorization", base64auth) response = client.Execute(request) This code worked perfectly prior to upgrading to VS 2019. Now, the response returns "Cannot send a content-body with this verb-type". I'm at a loss. Please advise, Thanks. Chris Campbell
1 REPLY 1
Courtney_E
Moderator
0 Votes

Hello Chris,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

It looks like we've already followed up with you directly via email, but I wanted to close the loop here as well. If you haven't received our reply, please let us know via email at webservices@constantcontact.com, and reference case number 31039435.

 

Please have a look and let us know if you have any other questions!

 


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up