Exemplo n.º 1
0
        public Task <RestResponse <T> > PatchAsync <T>(RestUri uri, RestRequestBody requestBody, ContentType contentType)
        {
            RestRequest request = CreateRestRequest(HttpMethod.PATCH, uri);

            request.Body        = requestBody;
            request.ContentType = contentType;
            return(InvokeAsync <T>(request));
        }
Exemplo n.º 2
0
        public Task <RestResponse> PutAsync(RestUri uri, RestRequestBody requestBody, ContentType contentType)//1
        {
            RestRequest request = CreateRestRequest(HttpMethod.PUT, uri);

            request.Body        = requestBody;
            request.ContentType = contentType;
            return(InvokeAsync(request));
        }
Exemplo n.º 3
0
        public virtual string Serialize(RestRequestBody body)
        {
            var dictionary = body.Content.ToDictionary();
            var nameValuePairStringBuilder = new List <string>();

            foreach (var property in dictionary)
            {
                string value = (property.Value ?? "").ToString();
                nameValuePairStringBuilder.Add(property.Key + "=" + System.Uri.EscapeDataString(value));
            }

            return(string.Join("&", nameValuePairStringBuilder.ToArray()));
        }
        public virtual string Serialize(RestRequestBody body)
        {
            var dictionary = body.Content.ToDictionary();
            var nameValuePairStringBuilder = new List<string>();

            foreach (var property in dictionary)
            {
                string value = (property.Value ?? "").ToString();
                nameValuePairStringBuilder.Add(property.Key + "=" + System.Uri.EscapeDataString(value));
            }

            return string.Join("&", nameValuePairStringBuilder.ToArray());
        }
Exemplo n.º 5
0
 public Task <RestResponse <T> > PatchAsync <T>(string resourceUri, object parameters, RestRequestBody body, ContentType contentType)
 {
     return(PatchAsync <T>(CreateRestUri(_baseUrl, resourceUri, parameters), body, contentType));
 }
Exemplo n.º 6
0
 public Task <RestResponse <T> > PatchAsync <T>(RestUri uri, RestRequestBody requestBody)
 {
     return(PatchAsync <T>(uri, requestBody, ContentType.ApplicationX_WWW_Form_UrlEncoded));
 }
Exemplo n.º 7
0
 public RestResponse <T> Patch <T>(string resourceUri, object parameters, RestRequestBody body)
 {
     return(PatchAsync <T>(resourceUri, parameters, body).Result);
 }
Exemplo n.º 8
0
 public RestResponse <T> Patch <T>(RestUri uri, RestRequestBody requestBody)
 {
     return(PatchAsync <T>(uri, requestBody).Result);
 }
Exemplo n.º 9
0
 public RestResponse Put(string resourceUri, object parameters, RestRequestBody body)
 {
     return(PutAsync(resourceUri, parameters, body).Result);
 }
Exemplo n.º 10
0
 public RestResponse Put(string resourceUri, RestRequestBody body)
 {
     return(PutAsync(resourceUri, body).Result);
 }
Exemplo n.º 11
0
 public RestResponse Put(RestUri uri, RestRequestBody requestBody, ContentType contentType)
 {
     return(PutAsync(uri, requestBody, contentType).Result);
 }
Exemplo n.º 12
0
 public Task <RestResponse> PutAsync(string resourceUri, object parameters, RestRequestBody body, ContentType contentType)//3
 {
     return(PutAsync(CreateRestUri(_baseUrl, resourceUri, parameters), body, contentType));
 }
Exemplo n.º 13
0
 public Task <RestResponse> PutAsync(RestUri uri, RestRequestBody requestBody)//2
 {
     return(PutAsync(uri, requestBody, ContentType.ApplicationX_WWW_Form_UrlEncoded));
 }
Exemplo n.º 14
0
 public RestResponse Post(RestUri uri, RestRequestBody requestBody)
 {
     return(PostAsync(uri, requestBody).Result);
 }
Exemplo n.º 15
0
 public Task <RestResponse <T> > PatchAsync <T>(string resourceUri, object parameters, RestRequestBody body)
 {
     return(PatchAsync <T>(CreateRestUri(_baseUrl, resourceUri, parameters), body, ContentType.ApplicationX_WWW_Form_UrlEncoded));
 }
Exemplo n.º 16
0
 public RestResponse Patch(RestUri uri, RestRequestBody requestBody)
 {
     return(PatchAsync(uri, requestBody).Result);
 }
Exemplo n.º 17
0
 public RestResponse <T> Patch <T>(RestUri uri, RestRequestBody requestBody, ContentType contentType)
 {
     return(PatchAsync <T>(uri, requestBody, contentType).Result);
 }
Exemplo n.º 18
0
 public RestResponse Patch(string resourceUri, object parameters, RestRequestBody body, ContentType contentType)
 {
     return(PatchAsync(resourceUri, parameters, body, contentType).Result);
 }
Exemplo n.º 19
0
 public RestResponse <T> Patch <T>(string resourceUri, RestRequestBody body)
 {
     return(PatchAsync <T>(resourceUri, body).Result);
 }
Exemplo n.º 20
0
 public Task <RestResponse <T> > PutAsync <T>(string resourceUri, RestRequestBody body)
 {
     return(PutAsync <T>(CreateRestUri(_baseUrl, resourceUri, new { }), body, ContentType.ApplicationX_WWW_Form_UrlEncoded));
 }
 public virtual string Serialize(RestRequestBody body)
 {
     return(SimpleJson.SimpleJson.SerializeObject(body.Content));
 }
Exemplo n.º 22
0
 public RestResponse <T> Put <T>(string resourceUri, object parameters, RestRequestBody body, ContentType contentType)
 {
     return(PutAsync <T>(resourceUri, parameters, body, contentType).Result);
 }
Exemplo n.º 23
0
 public RestRequestBuilder WithBody(RestRequestBody body)
 {
     _request.Body = body;
     return(this);
 }
Exemplo n.º 24
0
 public RestRequestBuilder WithBody(RestRequestBody body)
 {
     _request.Body = body;
     return this;
 }