#11490 closed bug (duplicate)
$.post() requires a value back
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$.post("/Foo", { id: "2" });
This will make Firefox state "no element found".
If on the server side there is:
[HttpPost] public void Foo(int id) { // Nothing }
However, if I switch the 'void' to 'bool' and return true, then it works:
[HttpPost] public bool Foo(int id) { return true; }
Now Firefox does not say "no element found" anymore.
It seems that jQuery requires/expects a value to be returned by the server for the POST request. However, the server already returns HTTP 200 OK which should be enough.
Change History (3)
comment:1 Changed 11 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
It is not possible to reproduce this with the echo service provided by jsfiddle because of limitations in jsfiddle. Namely it always returns a Content-Type header.
The bug occurs when the response does not contain a Content-Type header.
Duplicate of #11489.