Coder Social home page Coder Social logo

curlx's People

Contributors

apm963 avatar shivkanthb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

curlx's Issues

Ability to source control collections

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!

Handling of curl options with spaces in them

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.

Default Location of cxdb folder clutters /home directory

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.

curlx crashes ungracefully on invalid run id

When running the command: $ cx run 150, I get the following error.

Stacktrace
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.

curlx fails to display not JSON response

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

Default Accept header to 'application/json'

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.

Doesn't work with npx

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.