I am facing this problem which i can not find a solution for inside my sharepoint farm 2013 on-premises. now i have a security group named "Users & Workers
" and inside my javascript i am querying this security group, as follow:-
/_api/web/sitegroups/getbyname('User & Workers')/users/
but i am getting this error:-
A potentially dangerous Request.Path value was detected from the client (&).
i think the problem is related to the face that the group name contain this charecter &
. so is there a way to fix this ?
here is my javascript code which is responsible to do the call:-
url = "/_api/web/sitegroups/getbyname(" + "'" + FieldValue + "')/users/";
$.ajax({
url: url,
method: "GET",
async: false,
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
where the FieldValue
will be equal to User & Workers
here is the code from firefox F12 tools:-
GET http://t*******/_api/web/sitegroups/getbyname('Users%20&%20Workers')/users/
400 Bad Request
110ms
jquery-1.10.2.js (line 8720)
"NetworkError: 400 Bad Request -