How to send image using json to server on iPhone?

I am using json to communicate with the server.

I want to publish and capture an image from the server.

How to convert an image in json format for sending it, also when we get an image in json format and convert it back to an image.

+4
source share
3 answers

Refer to the appropriate section of the HTML specification on how to load binary data correctly.

JSON objects are published using very inefficient encoding for binary data. Using existing frameworks and standards to download binary data will save you a tremendous amount of time.

+4
source

The image is binary - you are probably better off sending a link to the image in your JSON, otherwise you need to deal with base64

+1
source

I found this site very useful: http://iphone.zcentric.com/2008/08/29/post-a-uiimage-to-the-web/

You do not need json to send to the server; just standard iPhone SDK methods.

0
source

All Articles