コード例 #1
0
        protected override void RunWebRequest(QueueManager qm)
        {
            RequestState requestState = new RequestState();

            requestState.OperationType = OperationType;
            requestState.httpMethod    = HTTPMethod.Post;

            var cub = new {
                id         = CreateUserID,
                email      = CreateUserEmail,
                name       = CreateUserName,
                profileUrl = CreateUserProfileURL,
                externalId = CreateUserExternalID,
                custom     = CreateUserCustom,
            };

            string jsonUserBody = Helpers.JsonEncodePublishMsg(cub, "", this.PubNubInstance.JsonLibrary, this.PubNubInstance.PNLog);

            #if (ENABLE_PUBNUB_LOGGING)
            this.PubNubInstance.PNLog.WriteToLog(string.Format("jsonUserBody: {0}", jsonUserBody), PNLoggingMethod.LevelInfo);
            #endif
            requestState.POSTData = jsonUserBody;

            string[] includeString = (CreateUserInclude == null) ? new string[] {} : CreateUserInclude.Select(a => a.GetDescription().ToString()).ToArray();

            Uri request = BuildRequests.BuildObjectsCreateUserRequest(
                string.Join(",", includeString),
                this.PubNubInstance,
                this.QueryParams
                );
            base.RunWebRequest(qm, request, requestState, this.PubNubInstance.PNConfig.NonSubscribeTimeout, 0, this);
        }