Jeff Thompson
Posts: 0
Joined: Wed Feb 13, 2013 6:54 pm

REST using GET instead of POST

My project tests fine in the "Mobile Preview" & using the Tiggzi Proxy on my REST Services. I launched the application on your hosting service, using a custom domain. An A record was created, and I can browse the application.

I can not get the REST service to use POST method even though the method and data type are both configured for POST and JSON. I've tried enabling/disabling the Tiggzi proxy and get the same result.

Here is the first part of the request. Note: I've removed domain and pagename actual values.

Request URL:[url=http://domain/pageName.css]http://domain/pageName.css[/url]
Request Method:GET
Status Code:304 Not Modified
Request Headersview source
Accept:text/css,/;q=0.1
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8

And the response:

Request URL:[url=http://domain/pageName.css]http://domain/pageName.css[/url]
Request Method:OPTIONS
Status Code:405 Method Not Allowed
Request Headersview source
Accept:/
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Access-Control-Request-Headers:accept, origin, content-type
Access-Control-Request-Method:POST

I've read through other posts on this Community suggesting the Service is configured for JSONP. I've confirmed the service is not configured for JSONP - our Server API does not support. I've tried with and without your Proxy and with & without a custom domain name (i.e.: tiggzi.net and our own).

I've previously shared the project with you - any help to resolve would be appreciated.

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

REST using GET instead of POST

When you host the app on a custom domain, the proxy is not used. Most likely that's what's happening. You can try running Chrome with security disabled to double check this.

Jeff Thompson
Posts: 0
Joined: Wed Feb 13, 2013 6:54 pm

REST using GET instead of POST

I've updated the Services with Proxy enabled and using ****.tiggzi.net instead of our custom domain. I am getting same error as the app continues to use GET.

Request:
Request URL:[url=http://***.tiggzi.net/EvoAirConfirm.css]http://***.tiggzi.net/EvoAirConfir...[/url]
Request Method:GET
Status Code:304 Not Modified

Response:
Request URL:[url=http://domain/events/create]http://domain/events/create[/url]
Request Method:OPTIONS
Status Code:405 Method Not Allowed
Request Headersview source
Accept:/
Accept-Charset:ISO-8859-1,utf-8;q=0.7,;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Access-Control-Request-Headers:accept, origin, content-type
Access-Control-Request-Method:POST
Connection:keep-alive
Host:domain:port
Origin:[url=http://.tiggzi.net]http://.tiggzi.net[/url]
Referer:[url=http://*.tiggzi.net/EvoAirMain.html]http://**.tiggzi.net/EvoAirMain.html[/url]
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17

This is using Chrome.

I've also tried on iPhone and it doesn't appear to be sending any events (we're not seeing anything in our Server API logs).

I'd like the App simply use POST - as configured in the App.

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

REST using GET instead of POST

Even when you use name.tiggzi.net -- the proxy is not used.

Jeff Thompson
Posts: 0
Joined: Wed Feb 13, 2013 6:54 pm

REST using GET instead of POST

Max - how do I get the REST Service to use POST vs. GET?

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

REST using GET instead of POST

You said:

[quote:]
My project tests fine in the "Mobile Preview" & using the Tiggzi Proxy on my REST Services.
[/quote]

When you host, the proxy is not used any more and thus it doesn't work. It might be something else but that's what I think is happening. See what you get in Console view.

Jeff Thompson
Posts: 0
Joined: Wed Feb 13, 2013 6:54 pm

REST using GET instead of POST

So when hosted, the application isn't using the REST Service setting "Method" = post, even thought that is what is configured?

Yes, the project tests fine in the builder. But I would like to have it working on your hosted offering. How do I get the REST Service (when hosted) to use POST vs. GET?

Image

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

REST using GET instead of POST

The service still does POST. The issue is that your service doesn't support cross-domain calls and thus it's not even invoked. http://docs.tiggzi.com/documentation/...

You should enable cross-domain calls for your service.

Return to “Issues”