how to post an xml file to a server?

Discussion in 'iOS Programming' started by sujithkrishnan, May 30, 2008.

  1. macrumors 6502

    Joined:
    May 9, 2008
    Location:
    Bangalore
    #1
    Hi all..
    I want to send a xml file to a particular server in my iPhone application...
    Kindly reply with what class i want to make use of?
    i ddnt find any HTTP classes.... (like httpRequest or httpResponse )

    Thanks...
    :)
     
  2. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    Not really sure, but the easiest way may be to wrap the UNIX command curl in an NSTask. I've used this technique for desktop Cocoa apps, I think it would probably work in an iPhone app as well. A long time ago there were rumors of an NSUpload class, but I don't think anything like that ever made it to daylight. NSURLConnection appears to be mostly for getting things off the net and not the other way around. Do you need to get progress as your file is uploaded or is it enough to send it on its way and be done with it? If the latter, curl is very easy to use.
     
  3. thread starter macrumors 6502

    Joined:
    May 9, 2008
    Location:
    Bangalore
    #3
    Thank you...
    But i ddnt get what u meant by "progress".
    I just want to send and xml file when user taps "Place my Order" button, and show the user a uploading progress (UI part) and finally a message in alertView "SUCCESSFULLY PLACED UR ORDER".....

    (If u are aware of MelissaData addresss Verification)
    i Think my criteria looks same as we using melissaData xml upload for address verification. i did it windows Mobile with apt APIs, beinga newbie to apple environment i ddnt find any thing regarding this.


    Hope u can guide me little more specific...
     
  4. thread starter macrumors 6502

    Joined:
    May 9, 2008
    Location:
    Bangalore
    #4
    Hi,

    I didnt get the necessary inof from any response..
    Thats y i am askng again???

    How to request a "POST" using NSURLRequest class methods???
    I want to send a xml to url

    http://yyyy.mydomain.com/action.do.

    Also i want to catch the xml file which is the response for that request...
     
  5. macrumors regular

    Joined:
    Feb 27, 2008
    #5
    Y tride Harrington NSURLConnection in gugl search isnt it some type of what y looked for?

    may y surmaze it some not exact wording here
     
  6. thread starter macrumors 6502

    Joined:
    May 9, 2008
    Location:
    Bangalore
    #6
    did it....

    Hi all.

    I did it by making use of

    NSMutableRequest's setHTTPMethod and setHTTPBody methods....

    Thnaks ....
     

Share This Page