Dariusz,
Thanks for your reply - I looked at that page before and did not understand
that extra params would be moved to the URL path! It makes more sense now.
I do have another, slightly related question about URL parameters, since
we’re on that topic - for plain HTTP channels, not outbound connections. I
have read the docs on channels several times but still cannot understand
why I am getting this behavior:
Channel 1, url: /zato/permissions/user/{user_id}
Channel 2, url: /zato/permissions/user/{user_id}/update
Channel 3, url: /zato/permissions/user/{user_id}/group/{group_id}
Whenever I create channels with the above structures or similar, any calls
to channel 2 or 3 will always be “intercepted” by Channel 1, because Zato
will for some reason assume everything after /user/ is a {user_id}! So I
cannot create any meaningful URL patterns, as POSTing to something like
/zato/permissions/user/rtsiomenko/group/1234 will always route to Channel 1
with “rtsiomenko/group/1234” as the user_id parameter. I am sure that I’m
missing something here, but I tweaked all the possible settings for a
channel - merging URL params to reqs, URL params priority, Params priority
- and still get this behavior. What is the correct way to deal with this?
Thanks again!
Rostislav
On Mon, Feb 16, 2015 at 5:10 PM, Dariusz Suchojad dsuch@zato.io wrote:
On 16/02/15 21:12, Rostislav Tsiomenko wrote:
‘response = conn.conn.get(self.cid, headers=headers, params={‘user_id’:
self.request.input[‘user_id’]})’
… the outbound connection successfully calls
’/permissions/user/rtsiomenko’.
However, I need to include a URL parameter at the end as well, so that
the URL that is called
is something like
/permissions/user/rtsiomenko?format=JSON&type=internal
Hi Rostislav,
here’s a usage example:
https://zato.io/docs/progguide/rest/outconns.html
If the params dictionary contains elements that are found not be needed
in the URL path, they will be provided to the target system in query
string.
In your example, given the path:
/permissions/user/{user_id}
and params
{‘user_id’:‘my-user’, ‘format’:‘JSON’, ‘type’:‘internal’}
the net result will be
/permissions/user/my-user?format=JSON&type=internal