apiaryio / curl-trace-parser Goto Github PK
View Code? Open in Web Editor NEWParser for output from Curl --trace option
License: MIT License
Parser for output from Curl --trace option
License: MIT License
There are some additional characters in parsed output when curl --silent
used as you can see in this gist. Do not use --silent
option as a workaround. :)
version 0.0.8
When a curl trace file is generated going against an endpoint using HTTPS, the resulting "Send SSL data", "Recv SSL data" chunks in the tracefile cause 'noisy' output for both the --raw and --blueprint options.
Removing these chunks from the tracefile eliminates the noisy output.
Perhaps the first for loop in the parse() function (in parser.js) could filter out these chunks?
But, on a more positive node, nice tool - as the description states, "If you want a human readable form then this parser is what you need". The blueprint output is a quite nice feature.
I noticed that the parser itself is actually completely free of dependencies, they're only used in the CLI. What do you think of splitting the CLI into its own repository (maybe curl-trace-parser-cli
)? It would reduce the update churn due to the new fixed versioning.
You need to include license text for MIT license
Request and response are pressed on one line if POST body is present, missing newline after data is breaking terminal:
kolotoc:curl-trace-parser netmilk$ curl --trace - --header "Content-Type: application/json" \
--silent --output /dev/null --request POST \
--data-binary "{ \"product\":\"1AB23ORM\", \"quantity\": 2 }" \
"http://curltraceparser.apiary.io/shopping-cart" | \
curl-trace-parser
POST /shopping-cart HTTP/1.1
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5
Host: curltraceparser.apiary.io
Accept: */*
Content-Type: application/json
Content-Length: 39
{ "product":"1AB23ORM", "quantity": 2 }HTTP/1.1 201 Created
Content-Type: application/json
Date: Sun, 21 Jul 2013 14:32:46 GMT
X-Apiary-Ratelimit-Limit: 120
X-Apiary-Ratelimit-Remaining: 118
Content-Length: 50
Connection: keep-alive
{ "status": "created", "url": "/shopping-cart/2" }kolotoc:curl-trace-parser netmilk$
Something like CoDo, Docco, or markdown in this repo is really needed.
Do you really need a POST example with POST data and a custom HTTP header in order to demonstrate how to run curl
and capture the traffic? I would suggest a simple GET without parameters or headers would suffice.
Don't publish code with require("coffee-script") into npm
, it's bad habit. Some people use CoffeeScript, others don't.
Instead - have a quick build task that compiles CoffeeScript into JavaScript and publish that. More details (.gitignore
, .npmignore
, the prepublish
script etc.) are here:
http://stackoverflow.com/questions/13645824/can-i-write-npm-package-in-coffeescript
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.