[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Posting MultPart Mime
hi Richard,
> Can anyone give me advice on how to post a multipart mime document (aka
> ebxml or soap with attachment)?
HTTPAPI does not have tools for building/formatting a MIME document.
You will have to create/format that document yourself. Once created,
HTTPAPI can send it.
> So, I need to insert the http headers, including total bytes as Content
> Length, then insert the soap doc, then insert a mime break, then insert
> the payload doc, then insert final mime break. Here is a sample of
> what it should look like.
HTTPAPI is going to take care of the HTTP keywords for you -- but it
won't take care of the MIME keywords or MIME formatting.
In your example, these are the HTTP keywords:
POST /rich HTTP/1.1
Connection: close
Cache-control: no-cache
SOAPAction: "ebXML"
Host: 172.16.16.10
Content-Type: multipart/related; type="text/xml"
start="20111205094816.header"; boundary="---ZMODEDI??gc0p4Jq0M2Yt50001"
Content-Length: 8740
HTTPAPI will automatically take care of all of those for you. It will
calculate the content-length from the length of the data you pass to it.
The values for the Content-Type and SoapAction fields are provided in
parameters that you pass to HTTPAPI.
Note that in older versions of HTTPAPI, the Content-Type and SoapAction
keywords were limited to shorter (64 char) variables. In the current
BETA of HTTPAPI, they allow up to 16k. So if the size of the parameters
isn't long enough in the copy you're using, please update to the one here:
http://www.scottklement.com/httpapi/beta
With those tips in mind, you should be able to call http_url_post_stmf()
to send the document (provided that it's formatted properly.)
Good luck
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------