I’ve been trying to query NCBI blast website using Android and BioJava. I’m using Eclipse with the Android emulator. When I run the code as an Android app I get the following errors:
W/System.err(533): java.io.IOException: An error occured submiting sequence to BLAST server. Cause: content-length promised 2000 bytes, but received 214
When I take the very same code and run it as a regular Java app it works perfectly. Any ideas on what it might be?
It also occured to me while I was trying to make a POST request in Android . If you set Content-Length in headers and the actual content has a different length, it will throw an
IOExceptionin Android (in plain JDK it worked, although it is wrong)You can reproduce the Exception using the following code:
so if you remove line
it will work!