View Full Version : How to override REST endpoints?

15 Jul 2013, 5:56 PM

I understand that one can override the endpoints for the REST proxy using the `api` configuration property. However, I still have a couple questions. Firstly, is there anyway I can tell ExtJS where to insert variables in those URL's, such as the ID? If I had an endpoint like this for example
/person?id=1, how would I tell ExtJS to use that instead of
/person/1 for example?

Also, is there anyway to allow say read and update, but not provide any methods for creating or removing records. How do I configure my REST proxy in that scenario?


15 Jul 2013, 7:39 PM
I have another question. Some of the things I'll be doing will not match the CRUD model, and so there will be instances where I'll just have to send bespoke requests to the server. Can someone point at the relevant documentation for issuing generic asynchronous requests with Ext JS?

17 Jul 2013, 1:02 PM
You could extend the Rest proxy and do your own implementation of the buildUrl method which is used to construct the URL used when communicating via the Rest transactions:

Instead of setting a URL on the proxy's url config you can specify an api config and set the url for just the read and update actions (though I'd think that ultimately prohibiting destroy and create actions would fall more to UI design):

For ad hoc transactions you can use Ext.Ajax.request().
You can pass a config as a param to request() including method which will allow you to specify the verb to use (POST, GET, PUT, etc.)

17 Jul 2013, 1:48 PM

17 Jul 2013, 7:57 PM
The basics of writing a custom proxy:


I'd also advise reading the source code for Rest proxy, there's not a lot to it.

Jarrod Roberson
16 Jan 2018, 9:29 AM
I'd also advise reading the source code for Rest proxy, there's not a lot to it.

Where is the source code found?

I have the commercial SDK and I can not find the source for the REST proxy anywhere.