Skip to Content
0

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

Feb 02, 2017 at 08:14 AM

36

avatar image
Former Member

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)

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Florian Pfeffer
Feb 02, 2017 at 08:46 AM
0

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')");
Share
10 |10000 characters needed characters left characters exceeded