How can I post XML data format to server?
(I only know post paramters to server)
Thank you!
It will depend on the server. You could get the NSData -bytes representation of the XML data and, if you're working with a RESTful web application, use PUT or POST when sending the data.
Related
I know for getting a data we have to use a GET request. But this time I have to send a XML document (who will not be stored) for getting the data. What are the best practice in this case ?
You need send a xml document to your end-point to get your interested data.
As you need a xml doc, it has to be a POST REST end-point. (On a side note, sending any file contents as part of GET parameters is a bad design practice.)
Hi,
I am a newbie to Backbone, My Rest Server Components Accept Only XML Requests, can Anybody show an example how do i send a xml to a rest api put request.
Backbone uses JSON by default, so to use XML you need to overwrite Backbone.sync. Take a look at this answer: How to override Backbone.sync?
I am developing an application which requiers me to convert an audio/video/image file into a 'BYTE ARRAY' and upload that to web services(REST) through a POST request. I am actually using ASIHTTPRequest (ASIFormData) to POST the data. But I could not find any class/method which will allow me to post the byteArray. Is there a way to do this....?
You can post any data with ASIFormDataRequest's setData. Here's an example.
You could create an NSData out of your bytes, and set that to the request using setData:.
NSData Class Reference
I am posting some values to dotnet webservice.For this i am using AsiFormDataRequest.Values are posted suceesfully but coming response is in xml format. so iam not able to get the success or failure message in json format.
What i want to do for getting json response after posting to server.
Thanking in advance.
You need to configure the server to respond with JSON instead of XML. There is nothing you can do about this from within your app. If you don't have control over the server then you need to forget JSON and parse the XML instead.
How to make facebook FQL query response in XML format?
You would have to have set your API Client's mode to XML. By default, it is responding in JSON these days (and the PHP client converts that to a PHP Array) but if you look at the API Test Console, you will see you can set the response mode of the client from XML, JSON, and what the PHP client returns.