Пример #1
0
    protected T POST <T>(string path, object payload)
    {
        var            fullPath = $"{API}/{Path()}/{path}";
        HttpWebRequest request  = WebRequest.CreateHttp(fullPath);

        request.Method      = "POST";
        request.ContentType = "application/json";
        client.AddAuthorization(request);

        AddPayload(request, payload);

        var response = GetResponse(request.GetResponse());

        return(JsonConvert.DeserializeObject <T>(response));
    }