[iPhone] How to POST url in safari

Hi!
I want my app to open url in Safari and to login.
I know how to just open URL:
UIApplication *app = [UIApplication sharedApplication];
[app openURL:[[NSURL alloc] initWithString:@"http://www.somedomain.net"]];
But there is a login form on that site. Here is it's code:
<form action="http://www.somedomain.net/login.php" method="post">
<td width="68%"><input name="username" class="formlogin" size="23" type="text" /></td>
<td width="10%"> </td>
</tr>
<tr>
<td>Password:</td>
<td><input name="pass" class="formlogin" size="23" type="password" /></td>
it looks like I have to POST params to http://www.somedomain.net/login.php
Well, I know how to POST
NSString *myRequestString = @"username=sampleuser&pass=samplepass";
NSData *myRequestData = [NSData dataWithBytes: [ myRequestString UTF8String ] length: [ myRequestString length ] ];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://somedomain.net/login.php" ]];
[ request setHTTPMethod: @"POST" ];
[ request setHTTPBody: myRequestData ];
NSURLConnection *connection = [[NSURLConnection alloc]
initWithRequest:request
delegate:self];
[connection release];
[request release];
But how to combine it all together? Just POSTing and calling openURL does not work. Is it possible at all? openURL opens safari and GETs? What if a site could log me in on GET request with username and pass as params, would openURL work then?

No, you cannot specify a request method in a URL.

Similar Messages

  • IPhone:  How to enable URLs in a block of rendered text

    I have a block of text that I am rendering as a table cell via an encapsulating UILabel. The block of text may optionally contain a URL. How can I prepare this view such that the link appears active to the user, and if touched, will start Safari on the URL?
    Thanks.

    Answering my own question, I believe the answer is to use a UIWebView, wherein links will be opened in the browser.

  • How to Specify URL in Safari Command Line?

    I would expect that this would work: safari www.google.com
    but it does not. Is there some kind of option switch needed?
    Thanks -- Vincent
      Windows XP Pro  

    I'm trying to set up a desktop shortcut to Safari, but passing a specific URL to it?
    I don't fully understand Kruskal's question that started this topic.
    But to create a desktop shortcut to a specific web page, just load the page in Safari and then drag the URL from the address bar to the desktop. Click on the little icon (the favicon) to the left of the URL and drag-and-drop.
    Edit: That's the Mac answer to this question; I didn't realize this was in the Windows Safari forum. I'm booting up Windows now to see if this holds true there...
    Edit again: That technique will work if Safari is your default browser in Windows. If not ... not.

  • How to see URL in Safari 6?

    This is driving me nuts. I can't see the URLs of any webpages that are open in any tabs in Safari. There must be some way to view the URL, right?
    The search/activity bar at the top of Safari only shows whatever I typed into it last (in any tab), which is typically a search term, not a URL; and the search/activity bar is not specific to tabs, so typing in the bar means you lose anything in the bar associated with another tab.
    My question: Is there a way to view the URL of the webpage you are on?
    I noticed some other support forums mentioned pressing esc or command-L. Neither works for me. I also don't see anything in any of the Safari menus or preferences, and the status bar doesn't seem to provide this information for the currently open webpage.
    Please help! Thanks!

    Try this.
    Safari > Preference > Advanced
    Show Develop menu in menu bar
    Checkmark the box to enable it.
    Develop menu will appear in the Safari menu bar.
    Now control clicking the page should produce a contextual menu.
    Best.

  • How to post URL link in sap script

    How to give link in sap script..
    For example if someone select [sap|www.sdn.sap.com]. it will direct to www.sdn.sap.com
    Regards
    Sas
    PS: Insert Test --> Hypertext option tried but not working properly...
    Hey no replies....any one any idea?

    I don't think sapscripts does  have the  option for  entering  hyperlinks.
    SAP has provided  smartforms/advance forms:
    Link: [hyperlink - smartform;
    Link: [https://help.sap.com/saphelp_47x200/helpdata/en/9b/e3b0e0c2a711d3b558006094192fe3/
    frameset.htm]
    Link: [Hyperlink in smartform]
    Link: [How to create a hyperlink in smartform]

  • How do I set the audience when I'm using Siri on my iPhone 5 to post to Facebook

    How do I set the audience privacy for when I’m using Siri on my iPhone 5 to post to Facebook?
    When I ask Siri to post a message to my Facebook Siri tells me what I have said and then asks tot post it, I then checked on my computer and the post is visible to "ME ONLY" I can change this on the computer and on my phone via the App but I do not want to be doing that all the time.
    If I post to Facebook via Siri on my iPhone 5 I want it at the default setting of friends only.
    So How do I change this?
    I posted the first one 2 minutes ago then went into Facebook via the App and changed it but did a second one hoping that the default privacy had changed but it was again to me only. As you can see via the padlock. Please help. Thanks

    What if you do need help or emergency situation while Posting FB via Siri is the fastest way to show you or someone is in danger, and he/she is dying because the post is Only visible to Me !?!?!?!???
    Anyone who uses FaceBook to get immediate help for life threatening emergency is mercifully removing themselves from the gene pool.

  • How do I set the Http Header POST URL in SAAJ?

    Hi ,
    I am a newbie in the field of web services. I was trying to create a SOAP request with Http Header POST information having a POST url like
    the following:
    POST /OMASTI.xml HTTP/1.1
    Content-Type: multipart/related; boundary="eladeladeladeladeladeladeladeladelad"; type=text/xml; start=11814460
    Content-Length: 54596
    Host: unspecified
    SOAPAction: ""
    to that effect I did the following in the SAAJ client:
    MimeHeaders md = message.getMimeHeaders();
              md.setHeader("SOAPAction" ,"\"\"");
              md.setHeader("POST" ,"/OMASTI.xml");
    However what I got was :
    POST / HTTP/1.1
    Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    SOAPAction: ""
    POST: /OMASTI.xml
    Content-Type: multipart/related; type="text/xml"; boundary="----=_Part_2_32124414.1153146262750"
    Content-Length: 3352
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.5.0_07
    Host: www.google.com
    Connection: keep-alive
    I have two POSTs in the header. How do I fix it? Please Help ASAP.
    Regards,
    Zeus

    Hi,
    Please forgive my ignorance. I did the same as you said. and then checked the Http request being sent out using ethreal software... it was the same as I had told earlier. Is only POST supported by the connection object? And the does the URL that comes in the Mime header as POST refer to the URL to which the request was sent? what I mean is that if the mime header says
    POST /OMASTI.xml HTTP 1.1, does it mean that the URL that was passed to the connection object was "/OMASTI.xml" ? I had given the url as http://www.google.com to test the request being sent.. I only have a sample SOAP request which shows a HTTP header with the post url as I said before. I need to create a SOAP request with the same sort of Http header and the body needs to follow a certain OMA-STI protocol. My experience in the SOAP domain is almost nil. So please enlighten me.
    Thanks in advance,
    zeus

  • HT4623 how do I get my safari back on the screen on my iphone ?

    how do I get my safari back on the screen on my iphone ?

    settings - general - reset - reset home screen layout.

  • How to Post XML Messages with SOAP Headers to a Trading Partner URL

    Hi All,
    Greeting to the Oracle B2B Community. We are currently working on how to post a Custom XML Message with SOAP Headers to a Trading Partner URL. I would really appreciate if anybody could provide me some inputs or links to some documentation on how to achieve the above requirement. The details are below:
    1. Our Internal Application generates a Flat File (PO Extract).
    2. The Extract then needs to be transformed to an XML Message. We are planning to use BPEL to do the transformation to XML Message.
    3. Once it is transformed to an XML message it needs to be posted to the Trading Partner URL as an HTTP Post and with SOAP Headers.
    We are planning to use B2B to do the posting but I am not sure on how to do the set-ups and what all parameter files in B2B needs to be updated in order to achieve the same. Also it is mandatory that we send SOAP Headers in the XML Message.
    Thanks In Advance for your help.
    Regards,
    Dibya

    Hello Dibya,
    As you are already doing the transformation from Flat file to XML in BPEL which is typically the capability of B2B, please use the Soap binding in BPEL to send the document to Trading partner.
    Rgds,Ramesh

  • How to disable the "autoload" of pdf in preview and url in Safari

    I hate that new feature,
    How can i disable the "resume" of pdf in preview and url in Safari on every time i restart those prg?

    Sorry Noel - create an extended desktop and open photoshop - create a file the same size as your second monitor and drag it over to the second screen. Press F to make it full screen and Ctl 1 to make it actual pixels. We now have just what we require for projection mapping onto say a building assuming the second monitor is a projector. Now take a brush and stamp it in the middle of your page - which is on the second monitor, photoshop itself is on your Ist monitor. If you press hold Shift down and stamp your brush at the edge of your full page you will see it jump too the side. It will also do this if you try to drag a selection too close to the edge. The page will begin to scroll to accomodate the selection which is perhaps useful in some circumstances but in others like to projection map it is a horror because we need the page to remain exactly where it is at all times or it will no longer be `registered` to the architecture previously done. Beleive me
    this can be deeply frustrating when you are out in the cold trying to get all the facets of a building mapped, but even when in the warm trying to do it with a theatre set. 
    Should you have a solution then you would indeed become much revered in these parts  - best wishes  John   --
     a couple of mapped buildings done with this method below
    http://vimeo.com/31496197               ness chrurch
    http://vimeo.com/17762125                 xmas lights

  • Can anyone tell me how to post videos taken on the iPhone that are now stored on the Air on Facebook?

    Can anyone tell me how to post videos taken on the iPhone that are now stored on the Air on Facebook?

    Hi
    Yeah got onto that but it won't load up anything readable. It just produces a little annimation of 35mm film strip and when you click on it - nothing. All you end up doing is clicking on the X in the top right hand corner of the annimation and deleting it. Really frustrating because uploading from the iPhone is simple, but I've deleted it off that and can't get it back from the Mac to the iPone either. Seem to be trapped no matter what i do.
    Thanks for your help though

  • Closing the url quits safari

    My safari application quits each time I colse the window. When I relaunch Safari
    the url that caused safari to quit reappers. If I try to open another tab it
    opens to the same url. Here is the problem report sent to apple.
    Process:         Safari [276]
    Path:            /Applications/Safari.app/Contents/MacOS/Safari
    Identifier:      com.apple.Safari
    Version:         5.1.7 (7534.57.2)
    Build Info:      WebBrowser-7534057002000000~1
    Code Type:       X86-64 (Native)
    Parent Process:  launchd [133]

    Please post the entire crash report including the, "binary images" section. There's not information available from your post.
    If Safari has just crashed, press the Report button on the CrashReporter dialog box to view the crash  information.
    Copy/paste the entire contents of the Crash Reporter window into your reply. If the crash report dialog does not appear or the crash is hard to reproduce, crash logs can be retrieved from the ~/Library/Logs/CrashReporter> folder.

  • I am a new Safari user.  How do I sync my safari bookmarks on one computer to all computers?

    I am a new Safari user.  How do I sync my safari bookmarks on one computer to all computers?  This can be easily done using Chrome, but I can't figure out how to do it using Safari?

    You are using icloud?
    maybe your account is not whit icloud and thats the problem
    o you dont have the same account in your iphone and ipad

  • How to post a table/set of records without losing formatting while posting

    how to post a table/set of records without losing formatting while posting in this message forum. Thanks

    Most forums have a FAQ. This one is no exception.
    It is in the right hand upper corner. It's URL is http://wikis.sun.com/display/Forums/Forums+FAQ
    Sybrand Bakker
    Senior Oracle DBA

  • How do I install the Safari web browser on my iPad?

    How do I install the Safari web browser on my iPad?

    Thank you for replying to my question.  Unfortunately, after I had posted it, I realised that I hadn't made myself clear and posted a subsequent question, which was 'how do I install the menu bar for Safari?'  Someone has replied to say that.I need to upgrade to ios8, but unfortunately I only have a first generation iPad which doesn't support this.  Do you know of any other way to install the menu bar?

Maybe you are looking for