Comments (4)
Do you want handlers that run for all requests under one resource? or do you want handlers for one particular request?
from jquery.rest.
for one particular request. mainly for update resource requests. but for GET method i want handle internal server side script errors contains in data argument.
for example:
restAjaxOptions = {
success: function(data, textStatus, jqXHR) {
if (data.rc == -1) {
alert("data too big");
} else {
// bla-bla-bla
}
},
//...
};
maybe there is another way?
from jquery.rest.
So update(id1, id2, idN, data)
only accepts IDs (to build the URL) and the POST/PUT body, though it returns a deferred object (a jquery promise). So what you want is:
client.foo.update({test:42}).done(successHandler);
client.foo.update({test:42}).fail(errorHandler);
//where errorHandler is function(xhr, result, statusText){...}
from jquery.rest.
ok. thank you. 👍
i casually read the manual.
from jquery.rest.
Related Issues (20)
- CDN Version HOT 1
- Type Error in .read() function HOT 2
- No 'Access-Control-Allow-Origin' HOT 6
- Access to HTTP return codes HOT 1
- Return a the HTTP Status code in the callback
- Content-Type is internally set to 'application/json' and can't be changed by config object
- Publish as npm or bower component HOT 2
- It would be great if WADL support is presented HOT 1
- Paginated results
- Is there any way to send PUT request context as application/json instead of form content type
- PATCH - Custom Verbs
- Delete records with parameters HOT 1
- Parameter to pass on every read() HOT 1
- Custom Headers HOT 1
- Ajax Options HOT 2
- 400 response crashes browser HOT 1
- Read method only allows one property to be passed in.
- json body instead of form data
- CSRF example: Django Rest Framework
- How to add Authorization token HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.rest.