예제 #1
0
        /**
         * Access token data is returned to the gadget as json key/value pairs:
         *
         *    { "user_id": "12345678" }
         */
        private HttpResponseBuilder formatAccessTokenData()
        {
            HttpResponseBuilder builder = new HttpResponseBuilder();

            builder.setHeader("Content-Type", "application/json; charset=utf-8");
            builder.setHttpStatusCode((int)HttpStatusCode.OK);
            // no need to cache this, these requests should be fairly rare, and the results should be
            // cached in gadget.
            builder.setStrictNoCache();
            JsonObject json = new JsonObject(accessTokenData);

            builder.setResponseString(json.ToString());
            return(builder);
        }