Skip to Content
avatar image
Former Member

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

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)

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 02, 2017 at 08:46 AM

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