djmnz / RestFluencing

MIT License
11 stars 4 forks source link

PATCH request acts as POST request #17

Closed natn2323 closed 5 years ago

natn2323 commented 5 years ago

I found that sending PATCH requests using the RestFluencing library actually sends POST requests. Doing some investigating, I found this:

/// <summary>
/// Prepare a PATCH request to the URL. You must have set the property <see cref="RestConfiguration.BaseUrl"/> of the configuration
/// </summary>
public static RestRequest **Patch**(this RestConfiguration config, string relativeUrl)
{
    if (config == null)
    {
        throw new ArgumentNullException(nameof(config), ErrorMessages.NoConfiguration);
    }

    if (config.BaseUrl == null)
    {
        throw new ArgumentException(ErrorMessages.BaseUrlIsNotSet, nameof(relativeUrl));
    }

    return Rest.**Post**(relativeUrl, config);
}

Was this a typo, or was this intentional and PATCH requests aren't currently supported?

natn2323 commented 5 years ago

Yeah, I've corrected the line and will make a pull request.

djmnz commented 5 years ago

Thanks I will merge it in 😁

djmnz commented 5 years ago

Released as version 1.1.1.48