How to upload image to remote server in iphone?

前端 未结 1 1052
孤街浪徒
孤街浪徒 2021-01-03 07:01

I am trying to upload a image which i am clicking with the help of the camera. I am trying the following code to upload the image to the remote server.

-(voi         


        
1条回答
  •  执念已碎
    2021-01-03 07:43

    You can use the libraries from a third party called asi-http-request. It simplyfies for you most of the hard works. In your case, you just do as the following:

    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    [request appendPostData:imageData];
    [request setRequestMethod:@"PUT"];
    

    0 讨论(0)
提交回复
热议问题