Comments (8)
Yes.
from elasticsearch-definitive-guide.
Clint, I thought this might be rather limitation of XMLHttpRequest object which is to my knowledge not part of JavaScript language specification but rather is provided in form of API in specific environments (such as web browsers).
from elasticsearch-definitive-guide.
Ah right, i see what you mean. That said, do you know of any implementations of javascript which do support GET with body?
from elasticsearch-definitive-guide.
IMO it is mixing of topics. JavaScript has nothing to do with GET. It is the web client or library that does the GET. May be there is a Node library that allows to do GET with body (I am not using it but may be Unirest allows that)? Or I can imagine calling Java API from JavaScript that would do it (so technically I would be using still JavaScript language and some API would allow me to do GET with body).
You can perfectly leave it as it is, I think many people will understand what you mean. It is that it just hit me into eyes ("... wait a sec. is this correct?"). But you know.. I might be oddball π
from elasticsearch-definitive-guide.
:)
from elasticsearch-definitive-guide.
Funny.
I looked into some Node http related libraries and surprisingly they often explicitly make sure they do not include body into request when doing GET. It is hardcoded into them, it is not by design of JavaScript language but rather practice. But is there actually any reason for this? I am afraid there might be one. The problem could be that HTTP RFC does not explicitly state how servers should treat GET requests with body. As a result some servers can simply reject GET requests with body.
curl -X GET 'http://google.com'
vs.
curl -X GET 'http://google.com' -d ' '
// using telnet it is even more interesting
If servers can do this so can proxy servers. And if this is really matter of server (or proxy) implementation why would only JavaScript HTTP clients be afraid of doing GET requests with body?
But in any case I think it might be valuable to elaborate this a little bit more in the book. I wouldn't be surprised if users of non-JavaScript clients would be hit by this as well (for example because these was very strict proxy in their way).
from elasticsearch-definitive-guide.
Yeah I agree we need to add some explanation. We often get people saying "you can't send a body with a GET" or that it is wrong. We should probably explain our justification for doing so, and the various workarounds available.
from elasticsearch-definitive-guide.
Why not saying "Ajax calls donβt allow request bodies with a GET request."?
from elasticsearch-definitive-guide.
Related Issues (20)
- Cluster Health - Drilling Deeper: Finding Problematic Indices - clarifications
- I can't visit the test data page HOT 1
- Mention a link to `FlakeID scheme` explanation.
- tribe
- Possible grammar mistake
- Date Math Typo
- prefix not result
- GET cannot use body HOT 1
- String is no longer a type
- Aggregations do not work because of disabled fielddata
- Sense/Kibana installation and links
- missing value in example query
- text exact match example outdated
- Outdated doc about the parent/child relationship (mapping, indexing, query syntax)
- A mapping example from the doc, gives `mapper_parsing_exception` error HOT 5
- Mismatch between query and explanation
- Enhancement Request: Amend Circuit Breakers Discussion To Include A Discussion of Maximum Cluster Operating Limits HOT 2
- [DOCS] Replace `/master/` and `/current/` references to Elasticsearch Reference Guide
- [Question] What version of Elasticsearch is the guide currently targeting? HOT 1
- can't start the doc
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 elasticsearch-definitive-guide.