Task #1456
Story #1418: d1_libclient_python refactoring
Refactor mime_multipart to support use by restclient better
100%
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 14 years ago
- Status changed from New to Closed
- Target version set to Sprint-2011.15-Block.2