Skip to content

Commit

Permalink
#6118 Fixed problem with Content-Type in the ShipStation Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
skoshelev committed Feb 9, 2022
1 parent 5e938c2 commit 6d39b20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -259,9 +259,8 @@ protected virtual async Task<IList<ShipStationServiceRate>> GetRatesAsync(GetShi

using var handler = new HttpClientHandler { Credentials = new NetworkCredential(_shipStationSettings.ApiKey, _shipStationSettings.ApiSecret) };
using var client = new HttpClient(handler);

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

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

return (await TryGetError(data)) ? new List<ShipStationServiceRate>() : JsonConvert.DeserializeObject<List<ShipStationServiceRate>>(data);
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Nop.Plugin.Shipping.ShipStation/plugin.json
Expand Up @@ -2,7 +2,7 @@
"Group": "Shipping rate computation",
"FriendlyName": "ShipStation",
"SystemName": "Shipping.ShipStation",
"Version": "1.23",
"Version": "1.24",
"SupportedVersions": [ "4.50" ],
"Author": "nopCommerce team",
"DisplayOrder": 1,
Expand Down

0 comments on commit 6d39b20

Please sign in to comment.