

Host: or Accept-Encoding: headers (for example to accept additionalĬontent encodings), specify skip_host or skip_accept_encoding with non-False String, and the HTTP version ( HTTP/1.1). It sends a line to the server consisting of the request string, the selector putrequest ( request, selector, skip_host=False, skip_accept_encoding=False ) ¶ This should be the first call after the connection to the server has been made. close ( ) ¶ Close the connection to the server.Īs an alternative to using the request() method described above, you canĪlso send your request step by step, by using the four functions below.

connect ( ) ¶ Connect to the server specified when the object was created. The defaultĭebug level is 0, meaning no debugging output is printed. Set the debugging level (the amount of debugging output printed). Note that you must have read the whole response before you can send a new Should be called after a request is sent to get the response from the server. The headers argument should be a mapping of extra HTTP The header Content-Length isĪutomatically set to the length of the file as reported by The body may also be an open file object, in which case theĬontents of the file is sent this file object should supportįileno() and read() methods. The Content-Length header is set to the length of the Strings are encoded as ISO-8859-1, theĭefault charset for HTTP. Present, it should be string or bytes object of data to send after This will send a request to the server using the HTTP request request ( method, url, body=None, headers= ) ¶ HTTPConnection instances have the following methods: HTTPConnection. This dictionary maps the HTTP 1.1 status codes to the W3C names.Įxample: is 'Not Found'. HTTPS_PORT ¶ The default port for the HTTPS protocol (always 443).Īnd also the following constants for integer status codes: Constant HTTP_PORT ¶ The default port for the HTTP protocol (always 80). The constants defined in this module are: http.client. BadStatusLine ¶ A subclass of HTTPException. ResponseNotReady ¶ A subclass of ImproperConnectionState. CannotSendHeader ¶ A subclass of ImproperConnectionState.

CannotSendRequest ¶ A subclass of ImproperConnectionState. ImproperConnectionState ¶ A subclass of HTTPException. IncompleteRead ¶ A subclass of HTTPException. UnimplementedFileMode ¶ A subclass of HTTPException. UnknownTransferEncoding ¶ A subclass of HTTPException. UnknownProtocol ¶ A subclass of HTTPException. InvalidURL ¶ A subclass of HTTPException, raised if a port is given and is either NotConnected ¶ A subclass of HTTPException. HTTPException ¶ The base class of the other exceptions in this module. The following exceptions are raised as appropriate: exception http.client. HTTPResponse ( sock, debuglevel=0, strict=0, method=None, url=None ) ¶ Class whose instances are returned upon successful connection.
#Python webdav client professional#
I'm on WinXP Professional SP1, ActiveState Python 2.4.This does not do any certificate verification. I did wonder if the win32net.NetUseAdd() call has any mileage as an alternative? Win32wnet.WNetAddConnection2( win32netcon.RESOURCETYPE_DISK, "z:", " ", "Web Client Network", " user at foo ", "password", 0) ? If the webdav prompt contains an basic authentication realm "foo", should my call be Utimately I need to turn on access control in the webdav server (that's part of the testing to conduct). Webdav locations tend to exist under My Network Places, so is the call getting hung up on trying to map drive Z ? But what should I pass in as the local name for the call to work? If I try to add a network place manually to the same location it succeeds. Win32wnet.WNetAddConnection2( win32netcon.RESOURCETYPE_DISK, "z:", " ", "Web Client Network", None, None, 0)Įrror: (53, 'WNetAddConnection2', 'The network path was not found.') I have an unsecured Tomcat4.1 server on a machine nearby which has a webdav folder installed.
#Python webdav client code#
I've tried various options, but after a load of digging I've sussed (hopefully correct!) that I should set the provider name to "Web Client Network" rather than None, since this always generated an error 67 code Hopefully I'm right in thinking the WNetAddConnection2() call is the right approach. After extensive googling I can't seem to find any examples in any language :-/ Perhaps that's a bad omen, but being optimistic. I'm trying to write a test harness for some application code, and part of the setup method is to map a network drive / network place to a webdav folder.

Previous message: Converting VB COM register program to Python.api for mapping webdav location in My Network Places? tim.fulcher at bt.com tim.fulcher at bt.com Api for mapping webdav location in My Network Places?
