Is there a way to do a PUT with WebClient?

There are overloads for UploadString that let you specify the method. For example, this one takes a Uri, a string for the method, and a string for the data.

using (var webClient = new WebClient())
{
    webClient.UploadString(apiUrl, 
        WebRequestMethods.Http.Put, // or simply use "PUT"
        JsonConvert.SerializeObject(payload))
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)