JsonPersister.apphb.com is a simple web site that store JSON objects for you. I did it for personal use when I am doing simple web/mobile prototypes, and have to store simple objects in the cloud.
{app-id} is an Id assigned by your application, it is simply a prefix to all of your resources. I recommend using a GUID, you can generate you here
{resource-id} is the Id you want to use for the specific resource
$.ajax({
type: 'POST',
url: 'http://jsonpersister.apphb.com/api/values/{app-id}',
data: { firstName: 'renan', lastName: 'stigliani', email: '[email protected]' },
dataType: 'json',
success: function(id) {
console.log('Resorce stored with id: ' + id)
}
});
Alternatively one can use PUT and specify the resource id:
$.ajax({
type: 'PUT',
url: 'http://jsonpersister.apphb.com/api/values/{app-id}/{resource-id}',
data: { firstName: 'renan', lastName: 'stigliani', email: '[email protected]' },
dataType: 'json',
success: function(id) {
console.log('Resorce stored')
}
});
$.ajax({
type: 'GET',
url: 'http://jsonpersister.apphb.com/api/values/{app-id}/{resource-id}',
dataType: 'json',
success: function(data) {
console.log(data)
},
});
And to GET all of your resources use:
$.ajax({
type: 'GET',
url: 'http://jsonpersister.apphb.com/api/values/{app-id}',
dataType: 'json',
success: function(data) {
console.log(data)
}
});
$.ajax({
type: 'DELETE',
url: 'http://jsonpersister.apphb.com/api/values/{app-id}/{resource-id}',
dataType: 'json',
success: function() {
console.log('Resorce deleted')
}
});
To DELETE all of your resources:
$.ajax({
type: 'DELETE',
url: 'http://jsonpersister.apphb.com/api/values/{app-id}',
dataType: 'json',
success: function() {
console.log('All resources deleted')
}
});