0

I'm trying to send an image as a Base64 encoded string to my PHP script via HttpGet, but as I kind of expected I get a 414 URI too large from my server.

Is there a way to post large strings with HttpGet?

Any help is greatly appreciated.

PinkFloydRocks
  • 808
  • 3
  • 14
  • 29

2 Answers2

1

URI limit depends on server settings and its not a good idea to send huge data via Get method. And no, you cant use Post on Get service.

The best would be to alter your webservice to receive Post request and then you may send as long data as you want

waqaslam
  • 67,549
  • 16
  • 165
  • 178
  • Yeah, I know it's not a good way of doing things, but I'm totally unable to reach my script by using HttpPost - if you could, please check out my other question: http://stackoverflow.com/questions/9920967/android-post-base64-string-to-php – PinkFloydRocks Mar 29 '12 at 09:32
  • I just added my answer to your other question. Not sure if its really helpful to you – waqaslam Mar 29 '12 at 09:47
1

when the URI is too large (cause of you are using it to send an image...) all you can do is to try to make it smaller, by compressing it. Or if you have access to the server, increase the limit....

the one way or the other.... use http-post instead of http-get. you wont have the problem that the size is limited (or if theres a limit, its way bigger then the one from http-get) and i cant believe that sending an image via http-get is usage as intended by the http

CAA
  • 968
  • 10
  • 27
  • Yeah, I know it's not a good way of doing things, but I'm totally unable to reach my script by using HttpPost - if you could, please check out my other question: http://stackoverflow.com/questions/9920967/android-post-base64-string-to-php – PinkFloydRocks Mar 29 '12 at 09:32