JsonUtility ignore URL parameters?

Hello,

i’m trying to retrieve json file from wordpress site.
the URL include some parameters (that should say to wordpress only send some specific fields) but it seems that the jsonutility ignore these parameters in the url.
this is the URL string:
https://public-api.wordpress.com/rest/v1.1/sites/somesite.wordpress.com/posts/__**?number=10&fields=title,featured_image&pretty=true**__

the bold\underlined part is ignored because it seems that full json file is sent every time…

this is the code i use:

[System.Serializable]
publicclassGetPostInfo
{
publicPostInfo[]posts;
publicintfound;

publicstaticGetPostInfoCreateFromJSON(stringjsonString)
{
returnJsonUtility.FromJson<GetPostInfo>(jsonString);
}
}

IEnumerator GetInfo() {
        WWW www = new WWW(url);
        yield return www;
        test = GetPostInfo.CreateFromJSON(www.text);
        Debug.Log (www.text);
    }

debug.log show the full json…

any idea?

OK, i found what is wrong but it’s really odd.
it seems that even when i changed the url in the script, in run time it used the original url before i changed it.
only when i refactor the url string variable to another name it started to use the new url string.
is there some kind of caching that need to be clear for www commands?

EDIT: stupid me! url variable was public… should be changed from the inspector. changed to private now all good!

:slight_smile: