This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-06-06
Channels
- # announcements (1)
- # babashka (40)
- # beginners (33)
- # calva (4)
- # cljfx (1)
- # clojure (63)
- # clojure-europe (25)
- # clojure-nl (2)
- # clojure-norway (73)
- # clojure-sweden (20)
- # clojure-uk (5)
- # clojurescript (10)
- # datahike (10)
- # events (1)
- # fulcro (17)
- # graalvm (62)
- # hyperfiddle (12)
- # other-languages (19)
- # practicalli (8)
- # reagent (1)
- # releases (1)
- # squint (14)
- # yamlscript (2)
hey does anymody know why i get less data with babashka.http-client than pinging my endpoint with curl? Its about elastic if i do a _cat/indices
in babashka i get less data but still valid than i get with curl
Just a guess: Could it be that one includes more data in the HTTP response header or something like that? Have you tried diffing the responses? I'm not sure what you mean by “less data.”
Also, I believe https://github.com/babashka/babashka.curl as well, so you could give that a go to see whether the response differs from curl outside of Babashka.

curl -XGET http://localhost:9200/_cat/indices?format=json this gives me 18 elements in the response array doing it with babashka same url gives me like 4
Are the elements of the same expected data “type” in both cases, i.e., only the number of elements differ? By “less data” do you mean fewer elements or fewer bytes? :thinking_face:
I presume your request headers and params are the same in both cases. Maybe inspect the requests to ensure they’re the same.
with curl -kv
it gives me
* TCP_NODELAY set
* Connected to localhost (::1) port 9200 (#0)
> GET /_cat/indices?format=json HTTP/1.1
> Host: localhost:9200
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< X-elastic-product: Elasticsearch
< Warning: 299 Elasticsearch-7.17.21-d38e4b028f4a9784bb74de339ac1b877e2dbea6f "Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See to enable security."
< content-type: application/json; charset=UTF-8
< content-length: 4147
<
I'm on my phone on vacation in Japan without a laptop waiting for my son to fall asleep in a dark bedroom 😄 I can't help you with the details off the top of my head in this particular situation, hehe 😅
and that is what bb gives me as headers
{content-encoding gzip, content-length 422, content-type application/json; charset=UTF-8, warning 299 Elasticsearch-7.17.21-d38e4b028f4a9784bb74de339ac1b877e2dbea6f "Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See to enable security.", x-elastic-product Elasticsearch}
I'm afraid I can't be of more help with the technical details of how to diff HTTP requests/responses from my phone. Perhaps I can tag team @U3X7174KS in here if he has the time and facilities to go deeper on that ☺️
ok strange if i use curl via the process api i get the same result as with babashka.http-client. So what is now the diffrence the process is even started with the same user 😄
but even if i directly call curl from the jvm i get less results than directly from bash
I’m lead to believe that the HTTP request must be different, as Michiel suggests. I’d try narrowing down the difference between the JVM HTTP Client and the Curl command line client.
With curl, you can use --verbose
to list the request HTTP headers. When I run
curl --verbose -I
, I get a part of the output that looks like this:
> HEAD / HTTP/2
> Host:
> User-Agent: curl/8.6.0
> Accept: */*
, meaning the Host
header is
, etc. You can override headers with -H
, like
curl --verbose -I -H 'User-Agent: teodors-agent'
i have switched the elastic into docker and somehow on the server someone started another native elastic which was installed on the server
Found [this](https://www.reddit.com/r/godot/comments/t33kxi/can_you_have_multiple_servers_on_one_port_or_do/#:~:text=this%20is%20possible%2C%20but%20it,they're%20on%20different%20interfaces.) on Google. Virtual network interfaces something-something - I guess it's a plausible explanation, since Docker creates those
localhost is 127.0.0.1 and ::1 (ipv6). it’s possible that one service binds to the port on ipv4 and the other one on ipv6. terrible, but true.
sorry must have scrolled past that