You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 5, 2025. It is now read-only.
CommitAsync return error 415. Solution is set a ContentType Media.
The rewritten method below:
public async Task CommitAsync(IEnumerable<string> handles, CancellationToken cancellationToken)
{
var path = "api/orders/feed";
var contentString = JsonSerializer.Serialize(new { handles });
var request = new HttpRequestMessage(HttpMethod.Post, path)
{
Content = new StringContent(contentString)
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json") // new
}
}
};
request.Headers.Add("Accept", "application/json"); // new
request.Headers.Add("X-VTEX-API-AppKey", _appKey);
request.Headers.Add("X-VTEX-API-AppToken", _appToken);
var response = await _httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
if (!response.IsSuccessStatusCode) throw new Exception($"Unable to execute POST in the path `{path}`, the status code was `{response.StatusCode}`");
}