ServiceStack / Issues

Issue Tracker for the commercial versions of ServiceStack
11 stars 6 forks source link

PatchAsync in JsonHttpClient always fails #744

Closed mlandtved closed 3 years ago

mlandtved commented 3 years ago

Using PatchAsync in JsonHttpClient always throws exception "Allowed HTTP methods 'PATCH' does not support the specified 'PUT' method". I believe it is caused by a bug in JsonHttpClient.cs

Current implementation public Task<TResponse> PatchAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default) => SendAsync<TResponse>(HttpMethods.Patch, ResolveTypedUrl(HttpMethods.Put, requestDto), requestDto); Should be changed to: public Task<TResponse> PatchAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default) => SendAsync<TResponse>(HttpMethods.Patch, ResolveTypedUrl(HttpMethods.Patch, requestDto), requestDto);

mythz commented 3 years ago

This should be resolved from the latest v5.10.3+ that's now available on MyGet.

thx for reporting 👍