예제 #1
0
        // Test with these:
        // OBSOLETE DATA:
        // http://localhost:51080/ArtistDiscog/Get/
        // http://localhost:51080/ArtistDiscog/Get/Artist%200
        // http://localhost:51080/ArtistDiscog/Get/?id=Artist%200
        // http://localhost:51080/ArtistDiscog/Get/?wikipedia=yyy
        // http://localhost:51080/ArtistDiscog/Get/?sectionId=Section%201%200
        // http://localhost:51080/ArtistDiscog/Get/?year=1991
        // http://localhost:51080/ArtistDiscog/Get/?albumId=Album%200%200%200

        public string Get(string[] id = null)
        {
            // Instantiate my homemade JSONPath Services object.  It does all the work:
            JsonPath jsonPathServices = new JsonPath();

            // Get the arguments from the command line URL and prepare them for usage.  Pass
            // them to the JSONPath query and execute it.  Return the result in JSON form:
            return(jsonPathServices.QueryJsonPathMain((HttpRequestWrapper)Request));
        }
예제 #2
0
        // Test with these:
        // OBSOLETE DATA:
        // http://localhost:51080/ArtistVideo/Get/
        // http://localhost:51080/ArtistVideo/Get/Artist%200
        // http://localhost:51080/ArtistVideo/Get/?title=Video%201%201%20title

        public string Get(string[] id = null)
        {
            // Instantiate my homemade JSONPath Services object.  It does all the work:
            JsonPath jsonPathServices = new JsonPath();

            // Get the arguments from the command line URL and prepare them for usage.  Pass
            // them to the JSONPath query and execute it.  Return the result in JSON form:
            string response = jsonPathServices.QueryJsonPathMain((HttpRequestWrapper)Request);

            // NOTE: The core JSON Path module has a bug for this data-type only.  Rather than
            // open that can of worms, I will simply patch the JSON:
            response = response.Replace("}]},", "},");

            return(response);
        }