I tried the code below but unable to do the post request when passing the variable to the path
var projectId = browser.driver.findElement(By.xpath("//data[contains(text(),'0')]"));
projectId.getAttribute('value');
var projectIdValue = projectId.getText();
projectIdValue.then(function(text) {
console.log(text);
const http = new HttpClient("https://xxxx/abc/d/");
console.log("http object data:"+ http.baseUrl);
var postResponse = http.post("/"++projectIdValue,'{"jsonrpc": "2.0", "id": 1, "method": "some method", "params":["100000",true]}','"Content-Type": "application/json');
http.failOnError = true;
expect(postResponse.statusCode).toEqual(200);
Tried passing Variable directly its working fine:
var projectIdValue = "127df5bc43a14059b2afa0aa78f19b0d";
//postResponse = http.post("/127df5bc43a14059b2afa0aa78f19b0d",'{"jsonrpc": "2.0", "id": 1, "method": "some method", "params":["0x989680",true]}','"Content-Type": "application/json');