473,220 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,220 software developers and data experts.

Http protocol Script

Hi,
I am new to Python and wrote a http protocol script. I got this error please slove this

my server:::



import string,cgi,time

from os import curdir, sep

from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer





class MyHandler(BaseHTTPRequestHandler):



def do_GET(self):

try:
send_response(200)

send_header('Content-type','text/html')

send_headers()





except IOError:

send_error(404,'File Not Found: %s' % self.path)


def xyz():

send_responce(200)
send_headers('Content_type','text/html')







def main():

try:

server = HTTPServer(('',50), MyHandler)

print 'started httpserver...'

server.serve_forever()

except KeyboardInterrupt:

print '^C received, shutting down server'

server.socket.close()



if __name__ == '__main__':

main()





My client:::

import httplib

conn=httplib.HTTPConnection('localhost',50)
conn.request('xyz','index.esp')
r=conn.getresponse()
print r.status


Error I got:::

localhost.localdomain - - [14/Sep/2007 11:43:53] code 501, message Unsupported method ('xyz')
localhost.localdomain - - [14/Sep/2007 11:43:53] "xyz index.esp HTTP/1.1" 501
Sep 14 '07 #1
0 918

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad...
1
by: Newbie | last post by:
I have set up an ASP script (with some help from microsoft.public.inetserver.asp.general!) that grabs the windows username of the user and puts it into an Access database. It is setup on IIS5 as a...
4
by: Bob Badger | last post by:
Hi, Simple question (although I guess with a complicated answer). Is HTTP an async protocol? For instance, if I send a message to a c# webservice via http what is the protocol actually doing? ...
7
by: Wladimir Borsov | last post by:
I want to call a perl script myscript.pl in my cgi-bin from a HTML web page. This call should NOT use SSI (because in this case HTTPS://.... protocol is necessary). Furthermore NO button click...
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
0
by: allavarapu | last post by:
Hi, I am writing http protocol to get some data from servers. If i was using my localhost, getting replay from local and if want access other remote sites, i am getting error. Please reply it...
1
by: welcomestocontact | last post by:
Hi, I am writing http protocol to get some data from servers. If i was using my localhost, getting replay from local and if want access other remote sites, i am getting error. Please reply it ...
6
by: hpatel | last post by:
Hi, I maintain a website for my organization. Recently, for a login page, I started using HTTPS. It works fine with HTTPS. The problem I face is : When a user goes to login page, he sees the...
7
by: Chris | last post by:
Is there a way when a user fills out a form and it asks them to enter a website that it'll be reformatted with http:// in front of it if it isn't already there. i.e. domain.com would become...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.