简体   繁体   中英

Using HTTP Post on an android device to put data on google app engine's blob store

I am trying to post data to the Blob Store on google's app engine, this code runs without throwing any exceptions, but on the blobstore end there is no log on the post request at all. The server side stuff works when i post using a form (albeit with mime data). I have allowed my android app to use internet. This is a stab in the dark but if any of you folks might have had an issue like this before perhaps the problem i am having might ring a bell!

public void sendVideo() throws IOException {
  // Create a new HttpClient and Post Header
  HttpClient httpclient = new DefaultHttpClient();
  HttpPost httpPost = new HttpPost("http://www.theurliampostingto.com/au813rsadjfaruh);
  // Add your data
  List<NameValuePair> pairs = new ArrayList<NameValuePair>();
  pairs.add(new BasicNameValuePair("key1", "value1"));
  pairs.add(new BasicNameValuePair("key2", "value2"));
  httpPost.setEntity(new UrlEncodedFormEntity(pairs));
  // Execute HTTP Post Request
  HttpResponse response = httpclient.execute(httpPost);
 }

You can try to intercept the traffic between the emulator and the server ie with WireShark to see if the server is responding to your request at all. Your code looks good for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM