Jul 05 2017 05:16 AM
Hello,
I need obtain information from a list using next call:
$url="http://myhost/_api/web/lists/GetByTitle('mylist')/items?$select=Title,CurrentYear&$filter=CurrentYear%20gt%202019" $webclient = new-object System.Net.WebClient $webclient.UseDefaultCredentials = $true $webpage = $webclient.DownloadString($url) $webpage
If I type the rest url in a browser I obtain my results filtered. It works fine.
But the same url in the previous code retrieves all the items. When I type $webpage, the results seem to ignore the url text after the ? symbol.
Thank you!
Jul 05 2017 05:23 AM
Jul 05 2017 07:56 AM
Jul 24 2017 12:19 AM - edited Jul 24 2017 12:22 AM
Jul 24 2017 12:19 AM - edited Jul 24 2017 12:22 AM
@Juan Carlos González Martín and @Pieter Veenstra, sorry for my delay... holiday....
The problem was concatenating strings. Using this way runs:
$url = “http://myhost/_api/web/lists/GetByTitle(%27mylist%27)/items?" + "$" + "select=Title,IDPeticio&" + "$" + "filter=IDPeticio%20gt%205080"