Re: [nodejs] sending a file using HTTP PUT

2012-07-24 Thread josh
btw i am able to do PUT using fs.readFile but i don't want to load each file into memory. is my api suppose to support streaming or should this piping approach works with any server? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Post

Re: [nodejs] sending a file using HTTP PUT

2012-07-24 Thread josh
great. it works for simple string - body: 'I am an attachment' now I want to stream a file. I am trying to pipe the readable stream of my file into the put request: file = fs.createReadStream('test-file').pipe(request.put('http://api.my-server.com:3000/test.foo/test-7)); and it looks fine (noth

Re: [nodejs] sending a file using HTTP PUT

2012-07-23 Thread Martin Cooper
On Mon, Jul 23, 2012 at 7:53 PM, josh wrote: > I try to make an HTTP PUT to an API. this endpoint allow sending a file and > it saves it somewhere for later retrieval. If you want to simply upload a file, you don't want to be making a multipart request, which is what your Node code is doing. Ins

[nodejs] sending a file using HTTP PUT

2012-07-23 Thread josh
I try to make an HTTP PUT to an API. this endpoint allow sending a file and it saves it somewhere for later retrieval. Here is the way I do it (successfully) with curl: curl -sSf -T file1 http://api.my-server/file1 (PUT)andcurl -O -L http://api.my-server/file1 (GET) Here is a verbose