views:

125

answers:

2

Hello Everyone,

as I have read in the ASI Documentation, its writen: "Data is posted in 'application/x-www-form-urlencoded' format, or 'multipart/form-data' format when uploading binary data or files."

That's exactly my Problem. I am sending just a String to a server, but the server just accepts 'multipart/form-data' and as I just send a String, the ASI Framework creates a POST request with 'application/x-www-form-urlencoded' format automatically, cause I am not sending any binary data or file. Result: the server does not accept my POST request.

How could I solve this problem?

Thanks in advance for helping.

A: 

I've just solved this problem in a very ugly way: I've changed the ASIFormDataRequest implementation on line 200:

if ([self postFormat] == ASIURLEncodedPostFormat) {
    [self buildMultipartFormDataPostBody];  //NEW LINE  
    //[self buildURLEncodedPostBody];  ORIGINAL LINE
} else {
    [self buildMultipartFormDataPostBody];
}

I would be glad to hear any other suggestion!

jcdmb
+2  A: 

You could set the format manually:

[request setPostFormat:ASIMultipartFormDataPostFormat];
pokeb