Skip to content

Commit

Permalink
change *.cc *.h to src/; bumped httpsync v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jul 23, 2012
1 parent f65007e commit f00fc04
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
build/
.lock-wscript
44 changes: 25 additions & 19 deletions README.md
Expand Up @@ -4,6 +4,12 @@
`http` module of node.js. But in contrast to `http` module's asynchronous
functions, node-curl provides the equivalent synchronous APIs.

## Install

```bash
$ npm install httpsync
```

## Build

node-waf configure && node-waf build
Expand All @@ -25,14 +31,14 @@
Example

```javascript
var req = curl.request ({
url: "http://cnodejs.org",
method: "GET",
useragent: "Ultimate Web Browser",
headers: {
"Tag": "TGB3123",
"String": "A long string"
}
var req = curl.request({
url: "http://cnodejs.org",
method: "GET",
useragent: "Ultimate Web Browser",
headers: {
Tag: "TGB3123",
String: "A long string"
}
});
```

Expand All @@ -43,13 +49,13 @@ var req = curl.request ({
And you can have

```javascript
var req = curl.get ({ url : "http://cnodejs.org"});
var req = curl.get({ url : "http://cnodejs.org"});
```

Or just straight forward

```javascript
var req = curl.get ("http://cnodejs.org");
var req = curl.get("http://cnodejs.org");
```

### request.write (chunk)
Expand All @@ -63,13 +69,13 @@ var req = curl.get ("http://cnodejs.org");
Example

```javascript
var req = curl.request ({
url: "http://cnodejs.org",
method: "POST"
var req = curl.request({
url: "http://cnodejs.org",
method: "POST"
});
req.write ("Some text\n");
req.write ("another text");
console.log (req.end ());
req.write("Some text\n");
req.write("another text");
console.log(req.end());
```

### request.endFile (filePath)
Expand All @@ -79,10 +85,10 @@ console.log (req.end ());
Example

```javascript
var req = curl.request ({
url: "http://cnodejs.org",
var req = curl.request({
url: "http://cnodejs.org",
});
req.endFile ("/etc/passwd");
req.endFile("/etc/passwd");
```

### response
Expand Down
1 change: 1 addition & 0 deletions index.js
@@ -0,0 +1 @@
module.exports = require('./build/Release/node_curl');
24 changes: 21 additions & 3 deletions package.json
@@ -1,5 +1,23 @@
{
"name": "node-curl"
, "version": "0.0.1"
, "private": false
"name": "httpsync",
"version": "0.0.1",
"scripts": {
"install": "node-waf clean ; node-waf configure build"
},
"description": "node-curl is a port of libcurl to node.js. Its interface emulates the `http` module of node.js. But in contrast to `http` module's asynchronous functions, node-curl provides the equivalent synchronous APIs.",
"main": "index.js",
"directories": {
"test": "test"
},
"repository": {
"type": "git",
"url": "git://github.com/zcbenz/node-curl.git"
},
"keywords": [
"curl",
"sync",
"http"
],
"author": "zcbenz",
"license": "MIT"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/test.js
@@ -1,5 +1,5 @@
var testy = require('./lib.js');
var curl = require ("../node_curl");
var curl = require ("../");

//-------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion wscript
Expand Up @@ -10,5 +10,5 @@ def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]
obj.target = "node_curl"
obj.source = "main.cc curl.cc request.cc"
obj.source = "src/main.cc src/curl.cc src/request.cc"
obj.lib = ["curl"]

0 comments on commit f00fc04

Please sign in to comment.