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


C# RestRequest.AddQueryParameter方法代码示例

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


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

示例1: CreateCountriesRequest

        public static RestRequest CreateCountriesRequest(int page, int countriesPerPage, RequestFormat format)
        {
            var restReq = new RestRequest(HttpMethod.Get);

            restReq.AddQueryParameter("format", format.ToString());
            restReq.AddQueryParameter("page", page);
            restReq.AddQueryParameter("per_page", countriesPerPage);

            return restReq;
        }
开发者ID:olegtyshcneko,项目名称:mvvmcrosspoc,代码行数:10,代码来源:RequestsFactory.cs

示例2: ValidarUsuario

        public async Task<UsuarioModel> ValidarUsuario(UsuarioModel usuario)
        {
            var request = new RestRequest("Usuario");
            request.Method = Method.GET;
            request.AddQueryParameter("Username", usuario.Username);
            request.AddQueryParameter("Password", usuario.Password);

            var response = await client.Execute<UsuarioModel>(request);
            if (response.IsSuccess) return response.Data;
            return null;
        }
开发者ID:M1r3l,项目名称:RedSocialXamarin,代码行数:11,代码来源:ServicioDatos.cs

示例3: ValidarUsuario

        public async Task<UsuarioModel> ValidarUsuario(UsuarioModel usuario)
        {
            var request = new RestRequest("Usuario");
            //Al request se le pueden añadir Headers, y al client se le pueden añadir credentials
            request.Method = Method.GET;
            request.AddQueryParameter("login", usuario.login);
            request.AddQueryParameter("password", usuario.password);

            var reponse = await client.Execute<UsuarioModel>(request);
            if (reponse.IsSuccess) return reponse.Data;
            return null;
        }
开发者ID:JCQuiroga,项目名称:RedContactos,代码行数:12,代码来源:ServicioDatos.cs

示例4: GetContactos

        public async Task<List<ContactoModel>> GetContactos(bool actuales, int id)
        {
            var request = new RestRequest("Contactos");

            request.Method = Method.GET;
            request.AddQueryParameter("id", id);
            request.AddQueryParameter("amigos", actuales);

            var reponse = await client.Execute<List<ContactoModel>>(request);
            if (reponse.IsSuccess) return reponse.Data;
            return null;
        }
开发者ID:JCQuiroga,项目名称:RedContactos,代码行数:12,代码来源:ServicioDatos.cs

示例5: ValidarUsuario

        public async Task<UsuarioModel> ValidarUsuario(UsuarioModel model)
        {
            var request = new RestRequest("Usuario") { Method = Method.GET };
            request.AddQueryParameter("username", model.Username);
            request.AddQueryParameter("password", model.Password);

            // la api devuelve error 404 si no existe, y restsharp peta
            var response = await _client.Execute<UsuarioModel>(request);
            if (response.IsSuccess)
                return response.Data;

            return null;

        }
开发者ID:FranLsz,项目名称:RedContactosXamarin,代码行数:14,代码来源:ServicioDatos.cs

示例6: GetAthleteActivities

        private async Task<List<ActivitySummary>> GetAthleteActivities(DateTime before, DateTime after, int page, int itemsPerPage)
        {
            var request = new RestRequest("/api/v3/athlete/activities");
            if (before != DateTime.MinValue)
                request.AddQueryParameter("before", before.GetSecondsSinceUnixEpoch());
            if (after != DateTime.MinValue)
                request.AddQueryParameter("after", after.GetSecondsSinceUnixEpoch());
            if (page != 0)
                request.AddParameter("page", page);
            if (itemsPerPage != 0)
                request.AddParameter("per_page", itemsPerPage);
            var response = await _client.RestClient.Execute<List<ActivitySummary>>(request);

            return response.Data;
        }
开发者ID:gabornemeth,项目名称:StravaSharp,代码行数:15,代码来源:ActivityClient.cs

示例7: GetComponentAsync

        public Task<Component> GetComponentAsync(string roomId, string deviceId)
        {
            var request = new RestRequest("component") {Method = HttpMethod.Get};
            request.AddQueryParameter("roomId", roomId);
            request.AddQueryParameter("deviceId", deviceId);

            var task = _client.Execute<Component>(request).ContinueWith(t =>
            {
                if (t.Result.StatusCode == HttpStatusCode.OK)
                {
                    return t.Result.Data;
                }
                throw new Exception("There is something wrong here");
            });
            return task;
        }
开发者ID:ywchang,项目名称:SmartHotel,代码行数:16,代码来源:ComponentRestServiceRepositoryAsync.cs

示例8: UsuarioNuevo

        public async Task<bool> UsuarioNuevo(string username)
        {
            var request = new RestRequest("Usuario");
            request.Method = Method.GET;
            request.AddQueryParameter("Username", username);

            var response = await client.Execute<bool>(request);
            if (response.IsSuccess) return response.Data;
            return false;
        }
开发者ID:M1r3l,项目名称:RedSocialXamarin,代码行数:10,代码来源:ServicioDatos.cs

示例9: GetUsuariosId

 public async Task<UsuarioModel> GetUsuariosId(int id)
 {
     var request = new RestRequest("Usuario");
     request.Method = Method.GET;
     request.AddQueryParameter("id", id);
     var response = await client.Execute<UsuarioModel>(request);
     if (response.IsSuccess)
         return response.Data;
     return null;
 }
开发者ID:M1r3l,项目名称:RedSocialXamarin,代码行数:10,代码来源:ServicioDatos.cs

示例10: CheckUsuario

        public async Task<bool> CheckUsuario(string email)
        {
            var request = new RestRequest("Usuario") { Method = Method.GET };
            request.AddQueryParameter("email", email);

            var response = await _client.Execute<bool>(request);

            if (response.IsSuccess)
                return response.Data;
            return false;
        }
开发者ID:FranLsz,项目名称:GestionDeTareasXamarin,代码行数:11,代码来源:ServicioDatos.cs

示例11: GetByGrupo

        public async Task<ICollection<TareaModel>> GetByGrupo(int id)
        {
            var request = new RestRequest("Tarea");
            request.Method = Method.GET;
            request.AddQueryParameter("idGrupo", id);

            var response = await client.Execute<ICollection<TareaModel>>(request);
            if (response.IsSuccess)
                return response.Data;
            return null;
        }
开发者ID:M1r3l,项目名称:TareasXamarin,代码行数:11,代码来源:Services.cs

示例12: GetTareas

        public async Task<ICollection<TareaModel>> GetTareas(int grupoId)
        {
            var request = new RestRequest("Tarea") { Method = Method.GET };
            request.AddQueryParameter("grupoId", grupoId);

            var response = await _client.Execute<ICollection<TareaModel>>(request);
            if (response.IsSuccess)
                return response.Data;

            return null;
        }
开发者ID:FranLsz,项目名称:GestionDeTareasXamarin,代码行数:11,代码来源:ServicioDatos.cs

示例13: GetMensajesEnviados

        public async Task<ICollection<MensajeModel>> GetMensajesEnviados(int userId)
        {
            var request = new RestRequest("Mensaje") { Method = Method.GET };
            request.AddQueryParameter("emisorId", userId);

            var response = await _client.Execute<List<MensajeModel>>(request);
            if (response.IsSuccess)
                return response.Data;

            return null;
        }
开发者ID:FranLsz,项目名称:RedContactosXamarin,代码行数:11,代码来源:ServicioDatos.cs

示例14: GetGrupos

        public async Task<ICollection<GrupoModel>> GetGrupos(int userId)
        {
            var request = new RestRequest("Grupo") { Method = Method.GET };
            request.AddQueryParameter("userId", userId);

            var response = await _client.Execute<ICollection<GrupoModel>>(request);
            if (response.IsSuccess)
                return response.Data;
            return null;
        }
开发者ID:FranLsz,项目名称:GestionDeTareasXamarin,代码行数:10,代码来源:ServicioDatos.cs

示例15: DeleteAmigo

 public async Task DeleteAmigo(int idUsuario, int idAmigo)
 {
     var request = new RestRequest("Contacto");
     request.Method = Method.DELETE;
     request.AddQueryParameter("idUsuario", idUsuario);
     request.AddQueryParameter("idAmigo", idAmigo);
     var response = await client.Execute<ContactoModel>(request);
 }
开发者ID:M1r3l,项目名称:RedSocialXamarin,代码行数:8,代码来源:ServicioDatos.cs


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