Can anyone tell how httpget function works with xpath query? Please find code as

Can anyone tell how httpget function works with xpath query? Please find code as below :

httpget(
endpoint:"http://<server-name>/resource/?xpath=/Person[FirstName='Smith']&attributes=FirstName",
paramNames:{},
paramValues:{},
headerNames :{"Content-Type"},
headerValues:{"application/json"},
user: <user_value>,
password:<password_value>
)

This gives error as Interface Definition: Error evaluating function 'httpget' : Invalid uri 'http://<server-name>/resource/?xpath=/Person[FirstName='Smith']&attributes=FirstName': Invalid query.


Also how to pass query parameters using paramNames and paramValues? We also tried below code but no success.

httpget(
endpoint:"http://<server-name>/resource/?xpath=/Person&attributes=FirstName",
paramNames:{"FirstName"},
paramValues:{"Smith"},
headerNames :{"Content-Type"},
headerValues:{"application/json"},
user: <user_value>,
password:<password_value>
)

OriginalPostID-143921

OriginalPostID-143921

  Discussion posts and replies are publicly visible

Parents
  • I would guess your second example should be something like the below:

    httpget(
              endpoint:"http://<server-name>/resource/",
              paramNames:{"xpath","attributes"},
              paramValues:{"/Person[FirstName='Smith']","FirstName"},
              headerNames :{"Content-Type"},
              headerValues:{"application/json"},
              user: <user_value>,
              password:<password_value>
    )
Reply
  • I would guess your second example should be something like the below:

    httpget(
              endpoint:"http://<server-name>/resource/",
              paramNames:{"xpath","attributes"},
              paramValues:{"/Person[FirstName='Smith']","FirstName"},
              headerNames :{"Content-Type"},
              headerValues:{"application/json"},
              user: <user_value>,
              password:<password_value>
    )
Children
No Data