mobile url headers

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

mobile url headers

Post by SparkOut » Thu Nov 12, 2015 8:25 pm

Is there ANY way to workaround the issue of libUrl not being completely workable on mobile? I specifically need to be able to read the headers returned from a POST request. (Posting user credentials, the site returns a cookie with the sessionID or other headers that can be parsed for failure, but without being able to catch the received headers, I can't parse.)
This isn't for "actually" logging into a website, just for user validation on to match a name on the device to a user account, so other libUrl features aren't really an issue. But I really need to be able to parse the returned headers OR find another way round this problem - any ideas?

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: mobile url headers

Post by SparkOut » Sat Nov 14, 2015 10:45 am

It's important to be able to catch the generated headers, as this site will redirect to the relevant page by outputting a location: header, which cannot be intercepted on Android afaik, and which the device does not follow (since it is not a browser instance). All that happens in this case is that the redirect times out and that's the only result that can be caught by the device (ie "timeout"). If I could catch the header which provides the redirect location then I could set the success status from that. I don't even need to catch cookies being set in this case (although that would be ideal). Is there any way to achieve what I need on Android? Please?

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: mobile url headers

Post by MaxV » Wed Nov 18, 2015 2:11 pm

This page can help you: http://web-sniffer.net/
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: mobile url headers

Post by SparkOut » Wed Nov 18, 2015 3:21 pm

Er max, how?

I am fully aware how to intercept and parse headers on desktop, from within my apps and browsers and external tools. However, to implement a POST to a website from a LiveCode app on mobile (specifically in my case Android) there is nothing received which is available to check. No libUrlLastRHHeaders equivalent. Not even "the result" contains anything useful.

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: mobile url headers

Post by MaxV » Thu Nov 19, 2015 3:00 pm

That URL requires to fill the cachpta, this not:
http://tools.seobook.com/server-header-checker/

You can use code like:

Code: Select all

put URL ("http://tools.seobook.com/server-header-checker/?page=single&url=" & myUrl & "&useragent=1&typeProtocol=11")
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: mobile url headers

Post by SparkOut » Thu Nov 19, 2015 6:13 pm

Hi Max

Again, I do NOT need any external or third party header checkers. Within the app when I post data to a service I need to be able to check the response from the server. Using any number of tools/sites I can see the returned headers and parse them. Except from within Android (or iOS) app, it is impossible to intercept the headers and check what page response is being made. libURL is not implemented fully for mobile in LC. What I need is an equivalent for libURLLastRHHeaders.

Is there a way to examine received headers from within a mobile app?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: mobile url headers

Post by jacque » Fri Nov 20, 2015 7:02 pm

Without libURL I think you're out of luck. You could try a feature request in the QCC and stress that your project depends on it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: mobile url headers

Post by SparkOut » Fri Nov 20, 2015 7:44 pm

There are already entries in QCC for this. I don't understand why libURLLastRHHeaders was never ported with the rest of the partial set of libUrl features. <sigh>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: mobile url headers

Post by jacque » Fri Nov 20, 2015 9:06 pm

LibURL wasn't really ported. Instead, a couple of native mobile functions were implemented independently by platform. Almost all of libURL is missing, and basically only the ability to POST and GET (and maybe another I don't remember) were written.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply