Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make this Web Api to work?
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01658678
Message ID:
01658796
Views:
48
>You shouldn't have to encode anything because the XHR request (ie. the Webrequest internal tot the browser) will automatically fix up the URL. If you want to be extra safe and don't rely on that behavior you can UrlEncode the parameterized value.
>
>Either way passing a parameters object in the .get() call will never fill these parameters - you need to hard code those as you show above or by using `encodeURIComponent()` to encode the values.
>
>
>services.Http.get("api/matrixTemplates/getAttributeValues/" + encodeURIComponent(id) + "/" + encodeURIComponent(criteria));
>
>
>https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent


Thanks, Rick. I think encodeURIComponent may be the ticket. I'll try that tonight. It will sure make my API function simpler.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform