cancel
Showing results for 
Search instead for 
Did you mean: 

XSJS net.http.Client - Request - Spaces in path

Former Member
0 Kudos

example XSJS
var client = new $.net.http.Client();
client.request(req, destination);
var req = new $.net.http.Request(method, path)
Problem
Passing a path with a space in it is not automatically transformed to a valid URI.
* path = /b1s/v1/Items('TEST_DSO4') => Works
* path = /b1s/v1/Items('ADALIE GREY') => Does not work
-> must be path = /b1s/v1/Items('ADALIE%20GREY')
I think this should be automatically done by the XSJS library. (POSTMAN does this also automatically)

Accepted Solutions (0)

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Kudos

You can use the JS function "encodeURI" to get a valid path for your case.

e.g.

var path = encodeURI("/b1s/v1/Items('ADALIE GREY')");