Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6064539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:17:29+00:00 2026-05-23T09:17:29+00:00

I’m working on an application that uses HttpResponse for network calls. Occasionally (about 30%

  • 0

I’m working on an application that uses HttpResponse for network calls.

Occasionally (about 30% of the time) network calls seem to fail with a 502 returning from the server. When checking the server logs, It appears that the server never received the request.

The logic doesn’t seem bad, however, and it does work most of the time. I am communicating to the server via JSON.

HttpClient client = new DefaultHttpClient();
HttpPost method = new HttpPost( BASE_URL + endpoint )
...add json entity
method.addHeader( "content-type", "application/json" );
        method.addHeader( "accept", "application/json" );

….call below function w client/method

protected HttpResponse invoke( HttpClient client, HttpUriRequest method ) throws ServiceException {

    HttpResponse response = null;

    try {
        response = client.execute( method );
    } catch ( //catch statements here ....)

    int status = response.getStatusLine().getStatusCode();
    //status = 502
}

The interesting thing about this call failing is that it’s the exact same call across devices, and the server it’s hitting is 20 feet away, although it does happen on a different server located in another state.

I can’t see why it works sometimes but not others.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:17:29+00:00Added an answer on May 23, 2026 at 9:17 am

    Run wire shark on both sender and receiver . Observe sends and receives. You should be able to see the cause of the problem.

    If you are getting a 502 error it suggests an intermediate device ( proxy,web filter,etc ) is blocking or ” eating ” your HTTP post .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.