ShipStation Plugin - Bug

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 anos atrás
I installed a new instance of nopCommerce 4.50 and configured ShipStation.
I tested and confirmed the ShipStation connection.
On step 3 (Shipping Method) of checkout, the following error message is displayed and logged.

Misused header name, 'Content-Type'. Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage, and content headers with HttpContent objects.

Page URL: /checkout/OpcSaveBilling/


Solution:
I updated the GetRatesAsync method in ShipStationServices.cs (starting on line 263)

From this:

client.DefaultRequestHeaders.Add("Content-Type", CONTENT_TYPE);
var responseData = await client.PostAsync($"{API_URL}{LIST_RATES_CMD}", new StringContent(JsonConvert.SerializeObject(postData)));


To this:

var httpContent = new StringContent(JsonConvert.SerializeObject(postData),Encoding.UTF8,CONTENT_TYPE);
var responseData = await client.PostAsync($"{API_URL}{LIST_RATES_CMD}", httpContent);
var data = await responseData.Content.ReadAsStringAsync();


That resolved the issue.


You can see my original post here:

https://www.nopcommerce.com/en/boards/topic/93165/nopcommerce-450-shipstation-error

Apologies for the double post. Originally, I wasn't sure if it was an actual bug or an error I made in configuration setup.
2 anos atrás
Hi, mstuart!

Thank you for your help. I create this ticket in our GitHub repository and will implement your suggestions after checking.
2 anos atrás
We have made the necessary changes, they will be available in plugin version 1.24 and higher. Details can be found in this commit.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.