Quantcast
Channel: Questions in topic: "webrequest"
Viewing all articles
Browse latest Browse all 387

Adding variables as a parameter in a URI or URL

$
0
0
I'm trying to get an object from a Back 4 App database. The URI only seem to work if I hard code the parameters. This works: string uri = "https://parseapi.back4app.com/classes/codes/?where={\"Code\":\"12345\"}"; This doesnt work: string uri = "https://parseapi.back4app.com/classes/codes/?where={\"Code\":\"" + code + "\"}"; I also tried with newtonsoft and still no luck: string code = JsonConvert.SerializeObject(new { Code = codeInputField.text.ToString() }); string uri = "https://parseapi.back4app.com/classes/codes/?where="+ code; Before you ask the input field works perfectly. When I Debug.Log the URI using newtonsoft of the second method, it shows the uri exactly as I want it. If you have any ideas how to fix this, let me know. I'm thinking that I'm not endording the URI properly but I don't know how to fix it

Viewing all articles
Browse latest Browse all 387

Trending Articles