PDA

View Full Version : how to post an xml file to a server?




sujithkrishnan
May 30, 2008, 07:30 AM
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...
:)



HiRez
May 30, 2008, 10:54 AM
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.

sujithkrishnan
Jun 2, 2008, 12:51 AM
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.

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...

sujithkrishnan
Jun 23, 2008, 07:42 AM
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.

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...

newb16
Jun 24, 2008, 08:28 AM
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...

Y tride Harrington NSURLConnection in gugl search isnt it some type of what y looked for?


and finally a message in alertView "SUCCESSFULLY PLACED UR ORDER".....

may y surmaze it some not exact wording here

sujithkrishnan
Jun 26, 2008, 01:11 AM
Hi all.

I did it by making use of

NSMutableRequest's setHTTPMethod and setHTTPBody methods....

Thnaks ....