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 8570073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:28:38+00:00 2026-06-11T18:28:38+00:00

My application uses standard httpUrlConnection code to connect to a python code on apache

  • 0

My application uses standard httpUrlConnection code to connect to a python code on apache http server.
All permissions of network access and internet are given. Previously I could not run this code as I was not using Asych (a different thread for network access) as I am working on Android 3.0 – Latest version. Now I am finished with this part.

No when I call the code below the response code is 200 which is all good:

#!/Python27/python
print "Content-type: text/html"
print
print "<html><head>"
print ""
print "</head><body>"
print "Hello."
print "</body></html>"

But when I use this code:

# Echo server program
import socket

HOST = '127.0.0.1'     
PORT = 80              
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
    data = conn.recv(1024)
    if not data: break
    conn.sendall(data)
conn.close()

it gives 404 response code saying Exception FileNotFoundException.

More addition, yes the code above is for a server and this is a sample code from python socket library (so all the comments are not mine). I am writing a similar server that would give database connectivity and post/get features.
So, Just need to make sure what is the problem with the server code above?

Any hints are more than welcomed.

Thanks.

  • 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-06-11T18:28:39+00:00Added an answer on June 11, 2026 at 6:28 pm

    The above echo server code could not be connected as this was not a http server and so no response code was programmed and other information required from a http server are not implemented.

    The code above it worked as it was ran from Apache so obviously that worked..
    Thanks for commenting…

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

Sidebar

Related Questions

My application uses HttpURLConnection to connect to my REST services. I log errors and
I have a standard web application deployed to an application server. The application uses
I created a java server that uses standard, non-encrypted sockets and an android application
My Windows Forms application uses the following standard line of code so that visual
I'm developing a CakePHP application which uses the standard CakePHP URL schema. If I
I am building an MVC 3 application which uses the standard Model validation attributes
I am trying to make a application that uses the standard Split View Application
I have a pretty standard .NET MVC 3 application that uses Ninject for dependency
My application uses MySQL, on my server, as its database. My server is highly
My application uses MS access database to save some sensitive information. Though that information

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.