Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-19-2011, 02:33 PM   #1 (permalink)
Registered Member
 
Join Date: Oct 2011
Posts: 2
Priya28 is on a distinguished road
Default Problem in sending HTTP Post

I am trying to upload image on the server. My webservice needs MemberID. Which I am passing in post1. But while running, it gives error "your webservice requires MemberID." and it fails. Can any one please help me with this? I tried a lot but can not figure out why it is failing.

NSString *post1 =[NSString stringWithFormat:@"memberId=%@",myID];
........

/*
create the body of the post
*/
NSMutableData *body = [NSMutableData data];
[body appendData:[[NSString stringWithFormat:@"rn--%@rn",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Type: application/octet-streamrnrn"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[post1 datausingEncoding:NSUTF8StringEncoding]];
[body appendData:[NSData dataWithData:imageData]];
[body appendData:[[NSString stringWithFormat:@"rn--%@--rn",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
// setting the body of the post to the reqeust
[request1 setHTTPBody:body];
Priya28 is offline   Reply With Quote
Old 10-20-2011, 01:34 PM   #2 (permalink)
Registered Member
 
Join Date: Oct 2011
Posts: 2
Priya28 is on a distinguished road
Default

Quote:
Originally Posted by jaibajaj View Post
First you have to do delete your history then try to upload your image. Your ID may be incorrect. So try one more time then ou face any problem ask me. I will help you....
Thanks for your reply. This is my first application in xcode and I am not sure how to delete history. I am pretty sure my ID is correct. But still, I tried with another Id as well but it gives me same error. Can you please help me with this? Thanks.
Priya28 is offline   Reply With Quote
Old 10-20-2011, 11:11 PM   #3 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 113
jonusx is on a distinguished road
Default

Use ASIHttpRequest You'll have a much easier time with it. I use it in my apps
__________________
What do you have to share? Share and view pics Oneshare

Play Magic: The Gathering? Try The Sylvan Archives!

Warhammer 40k your thing? W40k Manager is your thing.

Like karaoke? Try iSing Karaoke Locator
jonusx is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, xcode

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 403
15 members and 388 guests
13dario13, 7twenty7, buggen, eski, EvilElf, glenn_sayers, j.b.rajesh@gmail.com, LunarMoon, morterbaher, n00b, QuantumDoja, sacha1996, Sami Gh, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:27 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0