Re: Open safari and send post variables
Re: Open safari and send post variables
- Subject: Re: Open safari and send post variables
- From: Jim Turner <email@hidden>
- Date: Fri, 09 Jun 2006 11:22:53 -0500
- Thread-topic: Open safari and send post variables
Using a WebView will do what you need (if what you need is to post some
stuff to a form and display the results to the user). I do it for one of my
apps now.
The basic process is to load your page with the form in the webview, then
retrieve the DOMDocument from said view. Diddle the HTML elements to get
them where you need them (it's a little like Javascript... sorta), then
submit the page. Since the WebView is like a little mini-Safari, it'll show
the results just fine. WebView's delegates will tell you when the page has
completed loaded... or errored, if you're having problems.
I spent a lot of time here
http://www.devworld.apple.com/documentation/Cocoa/Reference/WebKit/ObjC_clas
sic/index.html
and digging around in the WebKit's headers to get it to work. It takes a
little bit to get running, but its very slick once you get it to fly.
Jim
On 6/9/06 11:01 AM, "Yorh" <email@hidden> wrote:
> Yes true,
>
> But how can I send post variables to my view?
> If I use the standard url connection the delegate returns me an
> NSData object... and I 'm not able to display the page :(
>
> Is there any way to do it?
>
> Thks
> Yorh
>
> On 09/giu/06, at 17:52, August Trometer wrote:
>
>> Why don't you just include your own WebView in the app. No need to
>> send Safari anything.
>>
>> -- August
>>
>>
>>
>>
>> On Jun 9, 2006, at 11:45 AM, Yorh wrote:
>>
>>> thks,
>>>
>>> This is my problem:
>>> I have a web site and I need to register my users via my app with
>>> post variables to make it more secure than get.
>>> But I would like to do it via browser because the app send a
>>> unique code to my mysql daemon ...
>>>
>>> So i need to open by clicking a button my web page with all the
>>> variables loaded (sent by the app).
>>> I know I can use GET vars but I really don't like that solution...
>>>
>>> thank you for support
>>> Yorh
>>>
>>>
>>> On 09/giu/06, at 17:37, Ken Tozier wrote:
>>>
>>>>
>>>> On Jun 9, 2006, at 11:11 AM, Keary Suska wrote:
>>>>
>>>>> on 6/9/06 7:55 AM, email@hidden purportedly said:
>>>>>
>>>>>
>>>>>> I know what you mean , but there are some problems:
>>>>>>
>>>>>> 1- In the URL field I will see the tmp path of course and not the
>>>>>> site URL
>>>>>> 2- The images of that web site will not loaded because the path...
>>>>>>
>>>>>> So I don't think this is the correct way to interact trough cocoa
>>>>>> with a web site...
>>>>>>
>>>>>> But if you have some other idea... :)
>>>>
>>>> Do you specifically want the user to interact with Safari? Or are
>>>> you just targeting Safari because it loads images for you
>>>> automatically? What if the user prefers to use Firefox, OmniWeb,
>>>> Opera, Shiira or (holds nose) IE?
>>>>
>>>> You mentioned loading images so are you really trying to read the
>>>> contents of a url extracting the images so you can display them
>>>> to the user? I'm sure there is someone (either Apple or third
>>>> party) has a Cocoa class that can read html files. You might even
>>>> be able to do it with NSXMLParser with a few tweaks.
>>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Cocoa-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Cocoa-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> 40metagraphics.it
>>
>> This email sent to email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
--
Jim Turner
Programmer/Analyst
The Des Moines Register
515/284-8223
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden