0

enter image description here

URL= http://peerro.com/index.php/api_v1/profile/upload_media

Multipart parameters-:

data = {"mediauploaddata": {
  "type" : "certificate",
  "id" : 168,
  "user_id" : 159
}
}

file=image

Note: please refer first images

Now custom header is

"session_token":"18cda675b659036e72002296c90dcea9d943d2aa37e9252d7b8a0dfa9d99252447c88d5d12564e9a11c5a462f774dc4e1cfb"

"Content-Type": "multipart/form-data"

Note-please refer second images:

enter image description here

Community
  • 1
  • 1
  • You don't have to add comment of "please help". We see the question and understand that you want help. The comment is unnecessary. Also, did you search for this question on Stack Overflow? It has been asked and answered many times. – Rob Jan 16 '18 at 18:16
  • 1
    Are you trying to build this request yourself which you're going to submit via `URLSession`? This can be done, but requires a bit of code. Much easier is to use framework like [Alamofire](https://github.com/Alamofire/Alamofire), which gets you out of the weeds of building multipart/form-data request. (See https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#uploading-multipart-form-data.) – Rob Jan 16 '18 at 18:16

0 Answers0