shivkanthb / curlx Goto Github PK
View Code? Open in Web Editor NEW◼️ Supercharge curl with history, collections and more.
Home Page: https://curlx.dev
◼️ Supercharge curl with history, collections and more.
Home Page: https://curlx.dev
Cloud 66 has a toolbelt (https://blog.cloud66.com/getting-started-with-cloud-66-toolbelt/) that I've been using for years as a part of different teams, and its CLI command is cx
much like curlx. Is there an easy way to adjust the command to be a different string of characters?
Great project, thank you for the awesomeness 🎉
I was wondering if there was a way to source control these collections, so everyone in my team could see it. I noticed that this line is only looking in the home directory.
Maybe it could be tweaked to accept any path?
I'd be happy to put in the work to make it support this, if you had any thoughts as to how this would look like.
Thanks!
I was trying curlx with the -H
option I often use with curl: cx "http://192.168.23.167" -H "Accept: application/json"
This caused the following error message:
Command failed: curl -i "http://192.168.23.167" "-H" "Accept:" "application/json"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 143 100 143 0 0 2465 0 --:--:-- --:--:-- --:--:-- 2465
curl: (6) Could not resolve host: application
(node:26295) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'responseHeaders' of null
at module.exports (/usr/local/lib/node_modules/curlx/cmds/curlx.js:8:37)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:26295) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26295) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Somehow the header got separated into two command-line arguments: "Accept:" "application/json"
which causes a subsequent error: curl: (6) Could not resolve host: application
The rest of the output seems to be an internal error.
I've tried a bit with single vs. double quotes, but could not get it working.
I'm using curlx v0.0.10 with zsh on Ubuntu, if it matters.
I like to keep my /home directory minimal when I ls ~
. It would be nice if the folder cxdb
was renamed to .cxdb
as the default. That's the simplest solution.
I suppose a more complex solution would be to allow for a config file in /etc
so that the location of the cxdb
folder could be set. Or an environment variable.
I would like to make a PR about this, but I'm trying an issue first to see if there's any response.
Love CX btw. Great simple idea.
When running the command: $ cx run 150
, I get the following error.
C:\Users\lux> cx run 150
C:\Users\lux\AppData\Roaming\npm\node_modules\curlx\cmds\run.js:15
if (request_id.indexOf(':') == -1) {
^
TypeError: request_id.indexOf is not a function
at module.exports (C:\Users\lux\AppData\Roaming\npm\node_modules\curlx\cmds\run.js:15:18)
at module.exports (C:\Users\lux\AppData\Roaming\npm\node_modules\curlx\index.js:25:28)
at Object.<anonymous> (C:\Users\lux\AppData\Roaming\npm\node_modules\curlx\bin\cx:2:15)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
Here is a link to the relevant code.
Hi there,
Thank you for your tool.
I have an issue when I try to get my elastisearch indices. The response is not a JSON format.
curlx fails to parse the supposed JSON response: Unexpected token y in JSON at position 1
It would be great if it display the response without formatting when the parsing fail.
What happens:
$ cx -X GET "http://localhost:9200/_cat/indices"
Unexpected token y in JSON at position 1
"Error while executing curl -i \"-X\" \"GET\" \"http://localhost:9200/_cat/indices\""
What it should do:
$ cx -X GET "http://localhost:9200/_cat/indices"
yellow open ******** VoYA-xUiTjSp-p_MI0NnCA 5 1 0 0 810b 810b
yellow open ******** evgkP-I0T4yV78KMKy2ROQ 5 1 0 0 810b 810b
Thanks
Martin
Currently the Accept
header is not set by default, which is fine by itself. However, most of curlx
expects the response to be in JSON format. I think it would be beneficial to set the Accept
header to application/json
by default and allow users to change or unset it.
Alternately, this could be a toggleable / configurable setting.
Great work!
A bit disappointed that it does not work with npx
.
For a light user of curl it would be very nice to be able to run this via npx (like npx curlx
or npx cx
) for someone who only uses it occasionally or for whatever reason cannot install this into their machine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.