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

            requestState.OperationType = OperationType;
            requestState.httpMethod    = HTTPMethod.Patch;

            var cub = new {
                id         = UUIDToUse,
                email      = UUIDEmail,
                name       = UUIDName,
                profileUrl = UUIDProfileURL,
                externalId = UUIDExternalID,
                custom     = UUIDCustom,
            };

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

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

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

            Uri request = BuildRequests.BuildObjectsSetUUIDMetadataRequest(
                UUIDToUse,
                string.Join(",", includeString),
                this.PubNubInstance,
                this.QueryParams
                );
            request = this.PubNubInstance.TokenMgr.AppendTokenToURL(request.OriginalString, UUIDToUse, PNResourceType.PNUUIDMetadata, OperationType);
            base.RunWebRequest(qm, request, requestState, this.PubNubInstance.PNConfig.NonSubscribeTimeout, 0, this);
        }