Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
HttpClient httpclient = new DefaultHttpClient();
            HttpPost httppost = new HttpPost(
                    "http://xxxxxxx/geo/getlocation.php");

            MultipartEntity reqEntity = new MultipartEntity(
                    HttpMultipartMode.BROWSER_COMPATIBLE);

            reqEntity.addPart("longtiude", new StringBody(mylong));
            reqEntity.addPart("latitude", new StringBody(mylat));
            reqEntity.addPart("newtimeString", new StringBody(time));
            reqEntity.addPart("dateString", new StringBody(date));
            reqEntity.addPart("locationName", new StringBody(address));

            httppost.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(httppost);

            String responseBody = EntityUtils
                    .toString(response.getEntity());
            Log.e("response", responseBody);

i am using httpclient to post on server using above code. but i got response like this

Your post request is not being received quickly enough please retry

i have add permissions and jar files correctly,also tried with basicnamevaluepair but same response. httpclient deprecated but it should work know...

i don't know the reason. what i am doing wrong. any help pls...

share|improve this question

2 Answers

up vote 1 down vote accepted

The server you are trying to hit has 'Slow HTTP Post DDoS Attacks' enabled, which is rejecting your request. The rule generally has some allowed time to receive the whole request, if it does not then the request will be denied.

share|improve this answer
thanks how to solve it. any setting possible to change on server – vsk Jul 13 at 9:48
@vsk it will depend on the device used for handling those attacks.For example, for F5 , here is a link : devcentral.f5.com/tech-tips/articles/… – Juned Ahsan Jul 13 at 9:51

This is the my way to create tab

public class MainActivity extends TabActivity {

TabHost tabHost;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Resources res=getResources();
    tabHost=getTabHost();
    TabHost.TabSpec spec;
    Intent in;



    in=new Intent().setClass(this, Search.class);
    spec=tabHost.newTabSpec("Search").setIndicator("Search",res.getDrawable(R.drawable.ic_launcher)).setContent(in);
       tabHost.addTab(spec);



    in=new Intent().setClass(this, Search2.class);
    spec=tabHost.newTabSpec("Point").setIndicator("Point",res.getDrawable(R.drawable.ic_launcher)).setContent(in);
       tabHost.addTab(spec);


     in = new Intent().setClass(this, Search3.class);
       spec = tabHost.newTabSpec("social").setIndicator("Social",
                          res.getDrawable(R.drawable.ic_launcher))
                      .setContent(in);
      tabHost.addTab(spec);

        // Contact tabs
        in = new Intent().setClass(this, Search4.class);
        spec = tabHost.newTabSpec("contact").setIndicator("Contact",
                          res.getDrawable(R.drawable.ic_launcher))
                      .setContent(in);

        tabHost.addTab(spec);
        tabHost.setCurrentTab(0);
}

}

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.