UnauthenticatedConnection() public method

Creates a connection with no authorization headers - used for requests that don't require authentication. This method does not actually perform the request - it returns the object to make the request with.
public UnauthenticatedConnection ( string query ) : IConsumerRequest
query string The url to connect to.
return IConsumerRequest
Esempio n. 1
0
        /// <summary>
        /// <para>Performs the Membership Method:
        /// Retrieve a member’s listings. GET
        /// </para><para>using the "query" string provided - should be the  "Member/{member_id}/Listings.xml" part of the url.
        /// It shouldn't include "http://api.trademe.co.nz/v1/".
        /// </para>
        /// DOES NOT REQUIRE AUTHENTICATION.
        /// </summary>
        /// <param name="query">The query string that will be added to the base url and used to connect to the API with.</param>
        /// <returns>Listings.</returns>
        public Listings MemberListings(string query)
        {
            var getRequest = _connection.UnauthenticatedConnection(query);
            var xml        = getRequest.ToString();

            return(Deserializer <Listings> .Deserialize(new Listings(), xml));
        }
Esempio n. 2
0
        /// <summary>
        /// A helper method for performing the http request for ListedItemDetail requests.
        /// </summary>
        /// <param name="url">The url used to connect to the API.</param>
        /// <returns>ListedItemDetail.</returns>
        private ListedItemDetail ListedItemDetailConnectionHelper(string url)
        {
            var getRequest = _connection.UnauthenticatedConnection(url);
            var xml        = getRequest.ToString();

            return(Deserializer <ListedItemDetail> .Deserialize(new ListedItemDetail(), xml));
        }
        // Categories:

        /// <summary>
        /// <para>Performs the category methods:
        /// Retrieve a list of all or part of our category tree,
        /// Retrieve a list of Trade Me Motors used car categories,
        /// Retrieve a list of Trade Me Motors motorbike categories,
        /// using the "query" string provided - should be the  "Categories/UsedCars.xml" part of the url
        /// it shouldn't include "http://api.trademe.co.nz/v1/".
        /// </para>
        /// DOES NOT REQUIRE AUTHENTICATION.
        /// </summary>
        /// <param name="query">The query string that will be added to the base url and used to connect to the API with.</param>
        /// <returns>Category.</returns>
        public Category RetrieveCategoriesByQueryString(string query)
        {
            var getRequest = _connection.UnauthenticatedConnection(query);
            var xml        = getRequest.ToString();

            return(Deserializer <Category> .Deserialize(new Category(), xml));
        }