v0.3.0
The SphereClient supports now create resource.
// example
var product = {
'name': {
'en': 'Foo'
},
'slug': {
'en': 'foo'
},
...
}
sphere_client.products.save(product)
.then(function(result){
// a JSON object containing a result
})
.fail(function(error){
// either the request failed or was rejected (the response returned an error)
})Improvements:
- response body is parsed as JSON 52fa744
- better error handling