开发者

How to send a parameter from a .NET Rest Client Method using GET

My Code:

    protected void btFeedsPorFechaPublicacion_Click(object sender, EventArgs e)
    {
        WebClient proxy = new WebClient();
        byte[] data = proxy.DownloadData(new Uri("http://tribilin.codefactorycr.com/SORS开发者_如何转开发SJ/rest/servicio/ObtenerFeedsRecientes"));

        System.Text.UTF7Encoding utf = new UTF7Encoding();
        string s = utf.GetString(data);

        FeedEstructuradoC[] d = JsonConvert.DeserializeObject<FeedEstructuradoC[]>(s);

    }

The Method ObtenerFeedsRecientes needs a param called "tag" how should i modify btFeedsPorFechaPublicacion to acomplished that?

Thank you!


The only thing i had to do was this:

byte[] data = proxy.DownloadData(new Uri("http://tribilin.codefactorycr.com/SORSSJ/rest/servicio/ObtenerFeedsRecientes/" + tbTag.Text));

In Get the param is assumed to be send without specifying its name! i didn´t know that. Hope this helps someone in the future ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜