I am doing a multipart POST to a form. The data contains a ZIP file so I need to include a "boundary". The problem I am having is that I cannot add the boundaries in between the data. Whenever I add them, it never shows uip in the header. How can I add the proper headers to my POST?
Code:
const char* boundary = "--------------------7d021a37605f0\r\n";
const char* allHeader = "Accept: */*\r\nCache-Control: no-cache\r\nAccept-Language: en-us\r\nContent-type: multipart/form-data; boundary=\"---------------------------7d021a37605f0\"\r\n";
HttpAddRequestHeaders(hResourceHandle,allHeader,strlen(allHeader)+1,HTTP_ADDREQ_FLAG_ADD);
const char * contentZipType = "Content-Type: application/x-zip-compressed\r\n";
HttpAddRequestHeaders(hResourceHandle,contentZipType,sizeof(contentZipType),HTTP_ADDREQ_FLAG_ADD);
/* binary data goes here */
HttpAddRequestHeaders(hResourceHandle,boundary,strlen(boundary)+1,HTTP_ADDREQ_FLAG_ADD);