当前位置: 首页>>代码示例>>C#>>正文


C# RestSharp.AddParameter方法代码示例

本文整理汇总了C#中RestSharp.AddParameter方法的典型用法代码示例。如果您正苦于以下问题:C# RestSharp.AddParameter方法的具体用法?C# RestSharp.AddParameter怎么用?C# RestSharp.AddParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RestSharp的用法示例。


在下文中一共展示了RestSharp.AddParameter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrepareRequest

 public override void PrepareRequest(RestSharp.RestRequest req)
 {
     req.AddParameter("clientString", _clientString, ParameterType.GetOrPost);
     req.AddParameter("client_id", _clientId, ParameterType.GetOrPost);
     req.AddParameter("userLogin", _username, ParameterType.GetOrPost);
     req.AddParameter("password", _password, ParameterType.GetOrPost);
 }
开发者ID:PearsonLearningStudio,项目名称:mobile2-windows7,代码行数:7,代码来源:FetchGrantService.cs

示例2: Authenticate

 /// <summary>
 /// Adds the API token key to the REST request header
 /// </summary>
 public void Authenticate(RestSharp.IRestClient client, RestSharp.IRestRequest request)
 {
     if (!request.Parameters.Any(p => p.Name.Equals("X-TOKEN", StringComparison.OrdinalIgnoreCase)))
     {
         var token = string.Format("{0}", _apiToken);
         request.AddParameter("X-TOKEN", token, ParameterType.HttpHeader);
     }
 }
开发者ID:1and1,项目名称:oneandone-cloudserver-sdk-dotnet,代码行数:11,代码来源:OneAndOneAuthenticator.cs

示例3: AddAuthTokensAsNecessary

        /// <summary>
        /// Adds the authentication tokens to the request if the parameters don't include them
        /// </summary>
        /// <param name="request">The request object to be checked</param>
        private RestSharp.IRestRequest AddAuthTokensAsNecessary(RestSharp.IRestRequest request)
        {
            if (string.IsNullOrEmpty(loginToken) == false && request.Parameters.Count(x => string.Equals(x.Name, clientConfig.TokenCookieName) == true) == 0)
            {
                request.AddParameter(clientConfig.TokenCookieName, loginToken);
            }

            if (string.IsNullOrEmpty(sessionToken) == false && request.Parameters.Count(x => string.Equals(x.Name, clientConfig.SessionCookieName) == true) == 0)
            {
                request.AddParameter(clientConfig.SessionCookieName, sessionToken);
            }

            return request;
        }
开发者ID:webcompere,项目名称:ALMRestClient,代码行数:18,代码来源:ALMClient.SessionManagement.cs

示例4: DoBeforeFinishWrite

 protected override void DoBeforeFinishWrite(RestSharp.RestRequest req)
 {
     for (int i = 0; i < this.TopicList.Count; ++i)
     {
         var topic = this.TopicList[i];
         string index = (i + 1).ToString("D2");
         req.AddParameter(_nameTag + index, topic.Name);
         req.AddParameter(_regexTag + index, topic.Regexes.Cat());
         req.AddParameter(_descTag + index, topic.Description);
     }
 }
开发者ID:sbuehler,项目名称:MailmanSharp,代码行数:11,代码来源:TopicsSection.cs


注:本文中的RestSharp.AddParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。