-1

The data that I want to send to server is of the form -

id : patient ID
email : patient Email
password: patient password
datesel:Date selection
description:Description of document
name:Name of Document
type:document type
image:uploaded file(can be image or file)

Output

{data:{status=0/1,message:"   "}}

Is there an existing API to do it? If not how can I upload the data with image ?

Thank you

Pang
  • 9,564
  • 146
  • 81
  • 122
Karan Singh
  • 40
  • 1
  • 5

2 Answers2

1

You can use NSURLConnection to do POST requests to a server. You should contact the party providing the server to ask if they have an API for that. If they use JSON, you can use NSJSONSerialization or a third-party library to help you construct your messages. Images could be included as Base64 encoded strings, but we need more information about the server API to really help you out.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
0

Glorfindel is correct. Firstly this all depends on server side. What type API thay are using ? what type of data they can receive ? NSJSONSerialization is good way to send data to the server. You can send image as Base64 encoded strings. server needs to decode it and save it accordingly.

Visit This Link How to send json data in the Http request using NSURLRequest

Community
  • 1
  • 1
Paras vora
  • 192
  • 12