Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » HttpRequest, Content-ID header in Part method
Re: HttpRequest, Content-ID header in Part method [message #44564 is a reply to message #44563] Tue, 31 March 2015 21:29 Go to previous messageGo to previous message
Zbych is currently offline  Zbych
Messages: 326
Registered: July 2009
Senior Member
Hi Sergey,

You are right. Probably we need more generic Part method with headers defined by a user. Maybe something like this:

HttpRequest& HttpRequest::Part(const Vector<String>& header, const String& data,
                               const char *content_type)
{
	if(IsNull(multipart)) {
		POST();
		multipart = AsString(Uuid::Create());
		if (content_type && *content_type)
			ContentType(String(content_type) + "; boundary=" + multipart);
		else ContentType("multipart/form-data; boundary=" + multipart);
	}
	postdata << "--" << multipart << "\r\n";
	for (int i = 0; i < header.GetCount(); i++){
		postdata << header[i] << "\r\n";
	}

	postdata << "\r\n" << data << "\r\n";
	return *this;
}

[Updated on: Thu, 02 April 2015 10:23]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to add statistics feature on SkyLark aplication?
Next Topic: [Bug] Httprequest - consecutive requests contain parts of previous requests
Goto Forum:
  


Current Time: Sat May 11 18:40:27 CEST 2024

Total time taken to generate the page: 0.02417 seconds