PostData not being received over 3G but is over wifi.

76 views
Skip to first unread message

Tom Gallacher

unread,
Jan 25, 2011, 6:41:14 PM1/25/11
to ASIHTTPRequest
Hi,

I have implemented ASIFormDataRequest within my application and I am
able to post and receive the correct http response over WIFI on an
iPhone 3Gs. However when the iPhone is then set to not use the wifi no
PostData is received by the server, however I am still able read the
response.

It seems strange that this works over wifi but not 3G.

Thanks,

Tom Gallacher

The my current implementation is:

ASIFormDataRequest *httpRequest = [ASIFormDataRequest requestWithURL:
apiUrl];
[httpRequest setPostValue:@"iphone" forKey:@"Text"];
[httpRequest setPostValue:@"iphone" forKey:@"SourceDevice"];
[httpRequest setPostValue:@"true" forKey:@"Debug"];
[httpRequest setFile:outputFileURL forKey:@"video"];
[httpRequest setUploadProgressDelegate:progressIndicator];
[httpRequest setTimeOutSeconds:20];
[httpRequest setDelegate:self];
[httpRequest setDidFailSelector:@selector(uploadFailed:)];
[httpRequest setDidFinishSelector:@selector(uploadFinished:)];
[httpRequest startAsynchronous];

With the debug params on I get this:

==== Building a multipart/form-data body ====
--0xKhTmLbOuNdArY
Content-Disposition: form-data; name="Text"

iphone
--0xKhTmLbOuNdArY
Content-Disposition: form-data; name="SourceDevice"

iphone
--0xKhTmLbOuNdArY
Content-Disposition: form-data; name="Debug"

true
--0xKhTmLbOuNdArY
Content-Disposition: form-data; name="video"; filename="movie-
encoded.mov"
Content-Type: video/quicktime

[64483 bytes of data from file '/tmp/movie-encoded.mov']

Anoop Nimkar

unread,
Jan 26, 2011, 7:42:17 PM1/26/11
to ASIHTTPRequest
Try doing [ASIHTTPRequest setShouldThrottleBandwidthForWWAN:YES] when
you try to upload data on the server over 3G.

This should solve your problem if there are no multiple requests going
on.

Jason Boehle

unread,
Jan 26, 2011, 7:47:09 PM1/26/11
to asihttp...@googlegroups.com
Anoop, is there an iOS or carrier limit on the number of active concurrent
requests when going over 3G or Edge?

>--
>You received this message because you are subscribed to the Google Groups
>"ASIHTTPRequest" group.
>To post to this group, send email to asihttp...@googlegroups.com.
>To unsubscribe from this group, send email to
>asihttpreques...@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/asihttprequest?hl=en.
>

Tom Gallacher

unread,
Jan 26, 2011, 8:38:25 PM1/26/11
to ASIHTTPRequest
After tcpdumping on my server I can see the only difference between
the two headers are that the Wifi connection has a cookie set. and the
3g connection has: Accept: */*.
Could it be the cookies not being handled correctly on 3G?

On Jan 27, 12:47 am, Jason Boehle <jboe...@couponsinc.com> wrote:
> Anoop, is there an iOS or carrier limit on the number of active concurrent
> requests when going over 3G or Edge?
>

Tom Gallacher

unread,
Jan 26, 2011, 8:50:38 PM1/26/11
to ASIHTTPRequest
Just to clarfiy i have tried Anoop's code that was provided however It
hasn't worked. As far as i am aware I am only making one single
request.

Tom Gallacher

unread,
Jan 27, 2011, 2:30:22 PM1/27/11
to ASIHTTPRequest
It seems that it could be the mobile phone network I am on, It seems
that post data is sent but not interpreted by Apache on Vodafone Uk.
However the same build on the same iPhone model on O2 Uk seems to post
fine.

Anoop Nimkar

unread,
Feb 7, 2011, 12:14:32 PM2/7/11
to ASIHTTPRequest
For me, I was trying to upload some data over 3G and simultaneous
requests for fetching data from server.

I was testing in United States and on At&T network. Bandwidth
throttling restricts number of bytes sent per second.

And that setting can be changed as per the requirement of network. I
am using default value in ASIHTTP.

Bandwidth throttling has is working fine for me. I am doing throttling
only when there is upload and not for other requests.

I am using my own Apache server where I am uploading data from mobile
phones.

Could you print what error message you are getting on server or
client ??
Reply all
Reply to author
Forward
0 new messages