Re: [racket-users] upload file with http post an Content-Type is multipart/form

2016-01-10 Thread 刘海宽
在 2016年1月9日星期六 UTC+8上午10:32:24,Neil Van Dyke写道: > One problem is that you should have *two* CR-LF byte sequences to > terminate the header list in each MIME multipart part. > > For example, instead of: > > "--" boundary CRLF > "Content-Disposition: form-data; name=\"file\"; >

[racket-users] upload file with http post an Content-Type is multipart/form

2016-01-08 Thread 刘海宽
Hi, I have a problem when upload file through http post method. Here is my code: #lang racket (require net/uri-codec) (require net/url) (require json) (require net/http-client) (define (->string bs) (if (bytes? bs) (bytes->string/utf-8 bs) bs)) (define (->bytes str) (cond

Re: [racket-users] upload file with http post an Content-Type is multipart/form

2016-01-08 Thread Neil Van Dyke
One problem is that you should have *two* CR-LF byte sequences to terminate the header list in each MIME multipart part. For example, instead of: "--" boundary CRLF "Content-Disposition: form-data; name=\"file\"; filename=\"And360.zip\"" CRLF "Content-Type: application/zip"