Closed iamxiaojianzheng closed 4 weeks ago
Seems to work for me, at least when using httpbin.org.
POST https://httpbin.org/post HTTP/1.1
Content-Type: application/json; charset=utf-8
{"title":"中文"}
Server responds with:
{
"args": {},
"data": "{\"title\":\"中文\"}",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Content-Length": "18",
"Content-Type": "application/json; charset=utf-8",
"Host": "httpbin.org",
"User-Agent": "kulala.nvim/3.2.2",
"X-Amzn-Trace-Id": "Root=1-66c0aedb-4fef252c64c025b71e58a522"
},
"json": {
"title": "中文"
},
"origin": "80.187.119.86",
"url": "https://httpbin.org/post"
}
Variables also seem to work fine.
GET https://httpbin.org/get?foo=中文 HTTP/1.1
Server responds with:
{
"args": {
"foo": "中文"
},
"headers": {
"Accept": "*/*",
"Host": "httpbin.org",
"User-Agent": "kulala.nvim/3.2.2",
"X-Amzn-Trace-Id": "Root=1-66c0afaa-7b981b37247eabb4728b0e13"
},
"origin": "80.187.119.86",
"url": "https://httpbin.org/get?foo=中文"
}
Maybe it has something to do with the shell?
I tried gitbash
, powershell
, cmd
.
The following three results are obtained.
gitbash
powershell
cmd
When variables are used, all three results are consistent.
curl version info
curl 8.9.0 (x86_64-w64-mingw32) libcurl/8.9.0 Schannel zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0
Release-Date: 2024-07-24
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL SSPI threadsafe UnixSockets zstd
Maybe it is either the shell or the curl version? Can you try wezterm?
Seems to be an issue with curl for windows? https://github.com/curl/curl/discussions/10446
You can always try the :lua require("kulala").copy()
command which should try to copy a curl command to your clipboard.
There you might add some -vvv
flags to debug what curl is doing.
It's a compatibility issue with curl on Windows.
I found a solution. Is it possible to do this in a configuration way in kulala?
echo -en "$(curl -s -X "POST" --data "{""title"":""中文""}" -H "content-type:application/json; charset=utf-8" --http1.1 -A "kulala.nvim/3.2.2" "https://httpbin.org/post")"
I have to think about a workaround for that, but have you tried this? https://user-images.githubusercontent.com/2276718/227071658-2c25848f-fd69-444a-a95b-0e77cc2f5437.png
This method, I have tried. But it still can't be solved.
Only slightly effective in gitbash
This method, I have tried. But it still can't be solved.
Only slightly effective in gitbash
Compared to before
Someone seems to have managed it with cmder:
I have to think about a workaround for that, but have you tried this? https://user-images.githubusercontent.com/2276718/227071658-2c25848f-fd69-444a-a95b-0e77cc2f5437.png
When I enable this, I have no problem accessing this interface.
But access to this interface, the result is still Unicode.
Someone seems to have managed it with cmder:
I tried this by myself on windows and it's working.
Chinese cannot be displayed properly
And when the post request parameter contains Chinese, it will be garbled.