Finbar Murphy
Posts: 0
Joined: Tue Aug 21, 2012 11:50 am

Understanding REST Request format

hi newbie on using tiggzi so this may be a dumb question, but am trying to get a rest definition that mimics the following

http://ipcpo.ag-itechnology.com/Login...: "root", "password": "root","repository_id": "" }

http://ipcpo.ag-itechnology.com/Login...

http://ipcpo.ag-itechnology.com/Login...

but it keeps throwing an error from the server is there a way to see exactly what is being sent in the http
I have setup up as a single parameter called json and populated it with the { string}, and am using the tiggzi proxy. Any suggestions welcome

Finbar Murphy
Posts: 0
Joined: Tue Aug 21, 2012 11:50 am

Understanding REST Request format

ok i see that my http strings got messed up

the post i want looks like this

ipcpo.ag-itechnology.com/Login?json={"username": "root", "password": "root", "repository_id": "" }

ipcpo.ag-itechnology.com/Login?json=%7B%22username%22%3A+%22root%22%2C+%22password%22%3A+%22root%22%2C+%22repository_id%22%3A+%22%22+%7D

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

Understanding REST Request format

Create a request parameter called 'json', then set its value to {"username": "root", "password": "root", "repository_id": "" }

Finbar Murphy
Posts: 0
Joined: Tue Aug 21, 2012 11:50 am

Understanding REST Request format

ok thanks I had done this but found I needed to also have the conetn type set to x-www-form-urlencoded. So now it works

I have a second question. I need to set a xhrFields in the ajax header

specifically

xhrFields: {
withCredentials: true
}

how / where is the best place to do this

Thanks

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

Understanding REST Request format

You can invoke a service from JavaScript:
http://help.gotiggr.com/documentation...

try passing the parameters like this:

serviceInstanceName.execute({xhrFields: {
withCredentials: true
}});

Finbar Murphy
Posts: 0
Joined: Tue Aug 21, 2012 11:50 am

Understanding REST Request format

ok i tried that but am still getting the same error from the sever

I can write the rest calls in java script using cross domain and it works ok

is there a way to export the Tiggzi app as HTML then i could load it directly onto the server and at least check if it's a cross domain issue ?

The only other thing i can see is the successfully GET looks likes

informu.ag-itechnology.com/NodeListing?json={%22ebikko_session_id%22:%22f3a848b287f8405f8c683e29fe03ae05%22,%22method%22:%22RECENTLY_UPDATED%22}&start=0&limit=100

and Tiggzi is sending

informu.ag-itechnology.com/NodeListing?json=%7B%22ebikko_session_id%22%3A%22dbe3db31aa4e452597be3faaaca786e9%22%2C%22method%22%3A%22RECENTLY_UPDATED%22%7D&start=0&limit=100

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

Understanding REST Request format

Yes, you can export the app. Click the Export button.

How did you define the request in Tiggzi? Can you attach a screen of the service editor?

Return to “Issues”