ptown Respected Contributor.
Respected Contributor.
273 views

REST Driver adding an unwanted forward slash

I am trying to submit a match query to a REST API.  It should look like this:

https://XXXX.jamacloud.com/rest/latest/users?username=R12345678

but the driver is adding a forward slash and it looks like this:

https://XXXX.jamacloud.com/rest/latest/users?username=/R12345678

As you can see below, the forward slash is not present in the association value .  Has anyone else encountered this and figured it out?

</source>
<input>
<driver-operation-data class-name="users" command="query" event-id="0">
<request>
<url-token association="R12345678" filter="?search-attr=username+eq+%27R12345678%27&amp;read-attr="/>
<header content-type="application/json"/>
{"scope":"subtree","event-id":"0","class-name":"users","search-class":["users"],"search-attr":[{"username":"R12345678"}],"read-attr":[""]}
</request>
</driver-operation-data>
</input>
</nds>
[06/26/19 12:25:01.125]:JAMA ST: JAMA: sub-execute
[06/26/19 12:25:01.126]:JAMA ST: JAMA: queryHandler
[06/26/19 12:25:01.126]:JAMA ST: JAMA: queryHandler: class-name == 'users'
[06/26/19 12:25:01.126]:JAMA ST: JAMA: Query: preparing GET to https://XXXX.jamacloud.com/rest/latest/users?username=/R12345678
[06/26/19 12:25:01.127]:JAMA ST: JAMA: Setting the following HTTP request properties:
Authorization:
[06/26/19 12:25:01.127]:JAMA ST: JAMA: content-type:application/json
[06/26/19 12:26:00.699]:JAMA PT:JAMA: poll
[06/26/19 12:26:00.699]:JAMA PT:Receiving DOM document from application.
[06/26/19 12:26:00.699]:JAMA PT:


Peggy Townsend
Novacoast
Labels (1)
5 Replies
Knowledge Partner
Knowledge Partner

Re: REST Driver adding an unwanted forward slash

Is it possibly this line:

<url-token association="R12345678" filter="?search-attr=username+eq+%27R12345678%27&amp;read-attr="/>

 

The %27?  But nope, that is a single quote URL escaped.  Is it possible the read-attr of / which should be like an XML null is inserting?

0 Likes
ptown Respected Contributor.
Respected Contributor.

Re: REST Driver adding an unwanted forward slash

I spent some time manipulating the xml to remove the read-attr from the filter and the value but the forward slash remains.  See below.

<input>
<driver-operation-data class-name="users" command="query" event-id="0">
<request>
<header content-type="application/json"/>
{"scope":"subtree","event-id":"0","class-name":"users","search-class":"users","search-attr":"username":"R12345678"}
<url-token association="R12345678" filter="?search-attr=username+eq+%27R12345678%27"/>
</request>
</driver-operation-data>
</input>
</nds>
[06/27/19 16:42:35.981]:JAMA ST: JAMA: sub-execute
[06/27/19 16:42:35.981]:JAMA ST: JAMA: queryHandler
[06/27/19 16:42:35.982]:JAMA ST: JAMA: queryHandler: class-name == 'users'
[06/27/19 16:42:35.982]:JAMA ST: JAMA: Query: preparing GET to https://xxx.jamacloud.com/rest/latest/users?username=/R12345678
[06/27/19 16:42:35.982]:JAMA ST: JAMA: Setting the following HTTP request properties:
Authorization:
[06/27/19 16:42:35.983]:JAMA ST: JAMA: content-type:application/json

 


Peggy Townsend
Novacoast
Knowledge Partner
Knowledge Partner

Re: REST Driver adding an unwanted forward slash

Stupid idea. How high have you kicked the RL or engine (depending on where it is running) trace level?  Try 25 or 100 or somesuch and see if anything hint like emerges.

 

0 Likes
ptown Respected Contributor.
Respected Contributor.

Re: REST Driver adding an unwanted forward slash

Increased trace did nothing.  I'm opening a ticket.  I'll report back.  I'm surprised no one else is reporting this issue.


Peggy Townsend
Novacoast
0 Likes
ptown Respected Contributor.
Respected Contributor.

Re: REST Driver adding an unwanted forward slash

Resolved.  It turns out that the REST API doesn't care if the forward slash is there or not.  If I query for users?username=ptown or users?username=/ptown the result is the same.  My user is found by both queries.  I discovered this by running the query both ways using postman.  


Peggy Townsend
Novacoast
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.