Project

General

Profile

Task #1456

Story #1418: d1_libclient_python refactoring

Refactor mime_multipart to support use by restclient better

Added by Roger Dahl almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
d1_libclient_python
Target version:
Start date:
2011-03-31
Due date:
% Done:

100%

Milestone:
Product Version:
*
Story Points:
Sprint:

Description

1)
The multipart class was design to perform a POST of the generated MMP document internally. It is now being used by the restclient, which has to call some internal methods of the class to get things working. This is introducing a subtle bug. In the restclient, the following code:

mm = multipart(headers, fields, files)
headers['Content-Type'] = mm._get_content_type()
headers['Content-Length'] = mm.getContentLength()

Clears the headers dictionary of the caller when getContentLength() is called. This is because
the dictionary is passed by reference to the multipart class, and multipart clears the dictionary
as part of the sequence that determines the MMP document length.

2)
Remove support for POST from multipart.

3)
When removing the POST method, it is no longer necessary for the class to take a headers argument. However, it does need to be able to return the header values for content-type and content-length.

History

#1 Updated by Roger Dahl almost 13 years ago

  • Status changed from New to Closed
  • Target version set to Sprint-2011.15-Block.2

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)