Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

all setup with new version

  • Loading branch information...
commit ab7676256925f2e5d69d0fed86bb58cefd263090 1 parent 4a9d9b3
@ded authored
Showing with 18 additions and 38 deletions.
  1. +16 −34 README.md
  2. +1 −2  reqwest.js
  3. +1 −1  reqwest.min.js
  4. +0 −1  src/reqwest.js
View
50 README.md
@@ -2,26 +2,13 @@
All over again. Includes support for xmlHttpRequest, JSONP, CORS, and CommonJS Promises A.
-The happs
----------
-
-``` sh
-$ git clone git://github.com/ded/reqwest.git reqwest
-$ cd !$
-$ npm install
-$ make
-```
-
-API
----------
+## API
``` js
reqwest('path/to/html', function (resp) {
qwery('#content').html(resp)
})
-```
-``` js
reqwest({
url: 'path/to/html'
, method: 'post'
@@ -30,9 +17,7 @@ reqwest({
qwery('#content').html(resp)
}
})
-```
-``` js
reqwest({
url: 'path/to/html'
, method: 'get'
@@ -41,9 +26,7 @@ reqwest({
qwery('#content').html(resp)
}
})
-```
-``` js
reqwest({
url: 'path/to/json'
, type: 'json'
@@ -53,9 +36,7 @@ reqwest({
qwery('#content').html(resp.content)
}
})
-```
-``` js
reqwest({
url: 'path/to/json'
, type: 'json'
@@ -69,12 +50,8 @@ reqwest({
qwery('#content').html(resp.content)
}
})
-```
-
-``` js
// Uses XMLHttpRequest2 credentialled requests (cookies, HTTP basic auth) if supported
-
reqwest({
url: 'path/to/json'
, type: 'json'
@@ -87,9 +64,7 @@ reqwest({
qwery('#content').html(resp.content)
}
})
-```
-``` js
reqwest({
url: 'path/to/data.jsonp?callback=?'
, type: 'jsonp'
@@ -97,9 +72,7 @@ reqwest({
qwery('#content').html(resp.content)
}
})
-```
-``` js
reqwest({
url: 'path/to/data.jsonp?foo=bar'
, type: 'jsonp'
@@ -109,9 +82,7 @@ reqwest({
qwery('#content').html(resp.content)
}
})
-```
-``` js
reqwest({
url: 'path/to/data.jsonp?foo=bar'
, type: 'jsonp'
@@ -187,16 +158,27 @@ var r = reqwest({
* `data` entity body for `PATCH`, `POST` and `PUT` requests. Must be a query `String` or `JSON` object
* `type` a string enum. `html`, `xml`, `json`, or `jsonp`. Default is inferred by resource extension. Eg: `.json` will set `type` to `json`. `.xml` to `xml` etc.
* `contentType` sets the `Content-Type` of the request. Eg: `application/json`
- * `crossOrigin`. for cross-origin requests for browsers that support this feature.
+ * `crossOrigin` for cross-origin requests for browsers that support this feature.
* `success` A function called when the request successfully completes
* `error` A function called when the request fails.
* `complete` A function called whether the request is a success or failure. Always called when complete.
+ * `jsonpCallback` Specify the callback function name for a `JSONP` request. This value will be used instead of the random (but recommended) name automatically generated by reqwest.
*
-## The Tests
+
+## Contributing
+
+``` sh
+$ git clone git://github.com/ded/reqwest.git reqwest
+$ cd !$
+$ npm install
+$ make
+```
+
+## Running Tests
``` sh
-npm test
+make test
```
## Browser support
@@ -259,7 +241,7 @@ jam install reqwest
```js
define(function(require){
- var reqwest = require('reqwest');
+ var reqwest = require('reqwest')
});
```
View
3  reqwest.js
@@ -1,4 +1,4 @@
-/*! version: 1.0.1
+/*!
* Reqwest! A general purpose XHR connection manager
* license MIT (c) Dustin Diaz 2013
* https://github.com/ded/reqwest
@@ -115,7 +115,6 @@
var reqId = uniqid++
, cbkey = o['jsonpCallback'] || 'callback' // the 'callback' key
, cbval = o['jsonpCallbackName'] || reqwest.getcallbackPrefix(reqId)
- // , cbval = o['jsonpCallbackName'] || ('reqwest_' + reqId) // the 'callback' value
, cbreg = new RegExp('((^|\\?|&)' + cbkey + ')=([^&]+)')
, match = url.match(cbreg)
, script = doc.createElement('script')
View
2  reqwest.min.js
@@ -1,4 +1,4 @@
-/*! version: 1.0.1
+/*!
* Reqwest! A general purpose XHR connection manager
* license MIT (c) Dustin Diaz 2013
* https://github.com/ded/reqwest
View
1  src/reqwest.js
@@ -109,7 +109,6 @@
var reqId = uniqid++
, cbkey = o['jsonpCallback'] || 'callback' // the 'callback' key
, cbval = o['jsonpCallbackName'] || reqwest.getcallbackPrefix(reqId)
- // , cbval = o['jsonpCallbackName'] || ('reqwest_' + reqId) // the 'callback' value
, cbreg = new RegExp('((^|\\?|&)' + cbkey + ')=([^&]+)')
, match = url.match(cbreg)
, script = doc.createElement('script')
Please sign in to comment.
Something went wrong with that request. Please try again.