-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ajax methods not parsing settings objext #2139
Comments
Documentation you've referred is for v4, and v5 has breaking changes compare to v4 and docs are not compatible. Currently ajax interface for rxjs/src/observable/dom/AjaxObservable.ts Line 66 in 6cf7296
|
@kwonoj Thank you. Can you give me a working example (without typesctipt) please? |
Test cases are usually most straightforward code snippet example, for cases like |
@kwonoj Now, it is correctly parsed, but with GET request, body param is ignored. POST and PUT requests are working. Is there a way to add url parameter in GET similar to jQuery param() ? |
Depends on usecases, you can use |
There are several problems within ajax:
const payload = {a: 1, b:2, c: {d:3}}
ajax.post(url, payload) // generates {a:1, b:2, c: "[object Object]"} nested parameter are not parsed |
Side note: You're not supposed to send a body with GET. |
The lack of clear examples for the latest version api is making it problematic to say the least. Tests and outdated documentation mean that its always a struggle to find any solutions. @javorka is correct, there is a range of issues with ajax, yet there is no solution or example offered. It has got to the stage where we are considering dropping the use of Observable ajax in favour of a more well documented library. The test example snippets do not show how to pass along parameters, which I believe to be the crux of the issue here. |
I admit the doc is not great but if you are setting up the header and the body properly here is something who works like a charm for me :)
|
Ajax methods is not parsing settings object, but treat it as url string. Docs here
RxJS version:
^5.0.0-rc.1
Code to reproduce:
Expected behavior:
Generates request
http://localhost:8080/api/some/endpoint/?problem=here
Actual behavior:
Generates request
http://localhost:8080/[object%20Object]
Additional information:
Whole settings object passed into the method ajax.get() is handled like url
The text was updated successfully, but these errors were encountered: