HttpClient httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("Accept", "application/json");
httpClient.DefaultRequestHeaders.Add("Authorization", "Basic 1234567890");
string jsonBody = "{\"payload\":\"hello world from sage 100\",\"payload_encoding\":\"string\",\"properties\":{},\"routing_key\":\"CustomerOrder_SageSync\"}";
StringContent stringContent = new StringContent(jsonBody, System.Text.Encoding.UTF8, "application/json");
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync(new Uri("http://12.34.56.78:8111/api/exchanges/%2f/amq.default/publish"), stringContent);
We are getting error 405 Method Not Allowed. This works from Visual Studio and from PostMan. Not sure what else to try as I use this same exact code in the legacy application to successfully make API calls to several other APIs.