Mo
Posts: 0
Joined: Thu Jun 07, 2012 2:43 pm

Test Connection adding ampersand?

I have added a service and am testing the connection but it is adding an ampersand at the end of the url, breaking the test. It wasn't doing this yesterday, and it's not doing it in the app test environment, but it makes it so I can't get the response and populate the response parameters. I tried testing in an existing service that worked fine yesterday and works fine in app test environment, but it added the ampersand in the test connection and broke the test. Sounds like a bug that popped up overnight. Any thoughts?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Test Connection adding ampersand?

Can you share the service URL, request parameters and the output that you get?

Mo
Posts: 0
Joined: Thu Jun 07, 2012 2:43 pm

Test Connection adding ampersand?

Here is the url:

https://baas.kinvey.com/appdata/kid17...

{where} reads from local variable in app environment, but for testing I populate with item like 'Soups'. Aside from authorization, that is only parameter.

Here is the response:

URL: https://baas.kinvey.com/appdata/kid17...
Method: get
Data Type: json
Content Type:
Security Context: 0
Request header parameters:
Request body parameters: where=Soups

Illegal character in query at index 58: https://baas.kinvey.com/appdata/kid17...&

This was not happening yesterday. And oddly enough, it works fine in app test environment where it is reading the variable from local storage.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Test Connection adding ampersand?

This is a bug, when adding a query. It works fine without the query (where you get all the objects). We'll fix it.

If you want to automatically create the service structure, you can still do it. Run the service on a page, open Chrome Developer Tools, Network tab and copy the result from a service. Then create the response from sample JSON: http://help.tiggzi.com/documentation/...

Mo
Posts: 0
Joined: Thu Jun 07, 2012 2:43 pm

Test Connection adding ampersand?

Thanks!

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Test Connection adding ampersand?

You don't need to wait for the fix, here is a better and more correct way to approach this. Create 'query' request parameter like this:

ol
liCreate service and set URL value: https://baas.kinvey.com/appdata/kid17.../li
liCreate request parameter: query/li
liGo to Data Mapping and map local variable to "query" parameter (or any other page component)/li
liDefine JavaScript for parameter mapping: return '{"items":"' + value + '"}'/li
liEnter value for "query" on test connection: {"items":"value"}/li
/ol

Return to “Issues”