I use httplib and a string template.
With a normal String as message, it is working, with a template I get :
Error 'must be convertible to a buffer, not Template'
message=str(SMessage.substitute(...
webservice = httplib.HTTP(host)
webservice.putrequest("POST", url)
....
webservice.send(message)
Do I need to convert my template, somehow ?
Template.substitute()method returns a string, you can dropstr()around the call. It also means that there might be another assignment tomessagethat is not shown in your code snippet that changesmessagefromstrtoTemplateor the error is raised in the different place (a full traceback can show where).