You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Chris Johnson <cs...@yahoo.com> on 2011/02/07 02:33:05 UTC
Unable to POST
I am testing Ext JS running on couch for some of the widgets. I am
running through some of the examples in Ext in Action, and in one of the
exaples, there is a POST to a local file that is intended to emulate an
actual response from the remote server. When I run the example in Couch,
I get the following error:
|{"error":"method_not_allowed","reason":"Only DELETE,GET,HEAD,PUT allowed"}
|
To test my sanity, I checked the same file in a standalone version of
Apache and it worked as expected:
|{success : true}
I know the preferred method when creating docs is to use the PUT method, but in this case, not sure I understand why Couch is balking at the request.
Here is a snippet of the code where the error occurs. Specifically the call to the url which returns {success : true}
Ext.Ajax.request({
url : 'scripts/successTrue.js',
params : {
records : recordsToSend
},
success : function(response) {
grid.el.unmask();
remoteJsonStore.commitChanges();
var result = Ext.decode(response.responseText);
}
});
|
Thanks
--cj--
Re: Unable to POST
Posted by Stefan Matheis <ma...@googlemail.com>.
Chris,
why not just send a PUT-Request with Ext? method: 'PUT' or sth like
that, should do the Trick
Regards
Stefan
On Mon, Feb 7, 2011 at 2:33 AM, Chris Johnson <cs...@yahoo.com> wrote:
> I am testing Ext JS running on couch for some of the widgets. I am running
> through some of the examples in Ext in Action, and in one of the exaples,
> there is a POST to a local file that is intended to emulate an actual
> response from the remote server. When I run the example in Couch, I get the
> following error:
>
> |{"error":"method_not_allowed","reason":"Only DELETE,GET,HEAD,PUT allowed"}
> |
>
> To test my sanity, I checked the same file in a standalone version of Apache
> and it worked as expected:
>
> |{success : true}
>
> I know the preferred method when creating docs is to use the PUT method, but
> in this case, not sure I understand why Couch is balking at the request.
>
> Here is a snippet of the code where the error occurs. Specifically the call
> to the url which returns {success : true}
>
> Ext.Ajax.request({
> url : 'scripts/successTrue.js',
> params : {
> records : recordsToSend
> },
> success : function(response) {
> grid.el.unmask();
> remoteJsonStore.commitChanges();
>
> var result = Ext.decode(response.responseText);
> }
> });
> |
>
> Thanks
> --cj--
>