backbone-models-react-native
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1260,7 +1260,7 @@ // Backbone.js 1.3.3 | ||
if ( status >= 200 && status < 300 || status === 304 ) { | ||
var json = undefined; | ||
try { | ||
options.success(JSON.parse(request.responseText)); | ||
} catch(e) { | ||
options.error(request); | ||
} | ||
json = JSON.parse(request.responseText); | ||
} catch(e) {} | ||
options.success(json); | ||
} else { | ||
@@ -1277,3 +1277,10 @@ options.error(request); | ||
request.open(options.type, options.url); | ||
request.send(); | ||
Backbone.trigger('pre_request', request); | ||
if ((["PUT", "POST", "PATCH"].indexOf(options.type.toUpperCase()) !== -1) && options.data) { | ||
request.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); | ||
request.send(options.data); | ||
} else { | ||
request.send(); | ||
} | ||
return request; | ||
}; | ||
@@ -1280,0 +1287,0 @@ |
{ | ||
"name": "backbone-models-react-native", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A fork of Backbone.JS without Views or Routers or jquery to work with react native", | ||
@@ -5,0 +5,0 @@ "main": "backbone.js", |
# backbone-models-react-native | ||
A fork of Backbone.JS without Views or Routers or jquery to work with react native | ||
## Warning: this is experimental. Use at your own risk. |
47640
1151
5