Hi, That is an odd request. Can you produce it with curl ? You could try to make your part something like this: | part | part := ZnMimePart fieldName: 'file' value: '123'. part headers at: 'Content-Type' add: ZnMimeType imageJpeg. part. This creates two values for Content-Type. Sven
On 10 Feb 2016, at 00:25, chicoary <chicoary@gmail.com> wrote:
I thank in advance if anyone can help me.
The code below:
ZnClient new url: 'http://127.0.0.1:5001/add?stream-channels=true'; addPart: (ZnMimePart fieldName: 'file' fileNamed: 'file.txt'); post.
generates the following response using netcat:
nc -l 5001 POST /add?stream-channels=true HTTP/1.1 User-Agent: Zinc HTTP Components 1.0 Content-Length: 194 Host: 127.0.0.1:5001 Content-Type: multipart/form-data;boundary=Boundary-Zn-IDMNDZTQ Accept: */*
--Boundary-Zn-IDMNDZTQ Content-Disposition: form-data;name="file";filename="file.txt" Content-Length: 16 Content-Type: text/plain;charset=utf-8
file.txt content --Boundary-Zn-IDMNDZTQ--
however I would like to get:
nc -l 5001 POST /add?stream-channels=true HTTP/1.1 User-Agent: Zinc HTTP Components 1.0 Content-Length: 194 Host: 127.0.0.1:5001 Content-Type: multipart/form-data;boundary=Boundary-Zn-IDMNDZTQ Accept: */*
--Boundary-Zn-IDMNDZTQ Content-Type: application/octet-stream Content-Disposition: form-data;name="file";filename="file.txt" Content-Length: 16 Content-Type: text/plain;charset=utf-8
file.txt content --Boundary-Zn-IDMNDZTQ--
I not figured out how to get the extra line "Content-Type: application / octet-stream" using Zinc.
----- http://chicoary@gmail.com -- View this message in context: http://forum.world.st/How-to-generate-Content-Type-application-octet-stream-... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.