PortableRest.RestRequest.AddQueryString C# (CSharp) Method

AddQueryString() public method

Appends a key/value pair to the end of the existing QueryString in a URI.
public AddQueryString ( string key, object value ) : void
key string The string key to append to the QueryString.
value object The value to append to the QueryString (we will call .ToString() for you).
return void
        public void AddQueryString(string key, object value)
        {
            AddQueryString(key, value.ToString());
        }

Same methods

RestRequest::AddQueryString ( string key, string value ) : void

Usage Example

Example #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public async Task<AdditionalImagesList> GetAdditionalImages(int setId)
 {
     var request = new RestRequest("getAdditionalImages", HttpMethod.Get)
     {
         ContentType = ContentTypes.Xml,
         IgnoreXmlAttributes = true
     };
     request.AddQueryString("apiKey", ApiId);
     request.AddQueryString("setID", setId);
     //RWM: Using this version handles null results and gives you access to possible exceptions.
     var results = await SendAsync<AdditionalImagesList>(request);
     return results.Content;
 }
All Usage Examples Of PortableRest.RestRequest::AddQueryString