The remote server returned an error (406) campaign monitor

969 Views Asked by At

I am using create-sent.net version 2.2 for CampaignMonitor. But recently I get this error:

System.Net.WebException: The remote server returned an error: (406) Not Acceptable.

at createsend_dotnet.HttpHelper.MakeRequest[T,U,EX](String method, CreateSendCredentials authCredentials, String path, NameValueCollection queryArguments, T payload)

from the service. Would there be any problem in HTTP header content-type?

2

There are 2 best solutions below

0
jazb On

Your service is saying that the response type returned is not provided in the Accept HTTP header in your Client request.

Ref: http://en.wikipedia.org/wiki/List_of_HTTP_header_fields

Find out the response (content type) returned by Service. Provide this (content type) in your request Accept header.

So you will have to supply a different one which is acceptable to the server.

0
Chinthaka Fernando On

Figured out the problem. The API was moved to HTTPS only. but inside our Http Request, we used HTTP URL. due to that reason the API returns (406) Not Acceptable code.