• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    Go
  • Created over 9 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

gencurl generates a curl command based on an http.Request to be used for logging and debugging

gencurl

gencurl generates a curl command based on an http.Request to be used for logging and debugging

// create an http request
data := []byte(`{"key":"value"}`)
req, err := http.NewRequest("POST", "http://www.example.com", bytes.NewBuffer(data))
if err != nil {
    // handle err
}
req.Header.Add("X-Custom", "custom data")

curl := gencurl.FromRequest(req)

// later, execute the request. On error, you can print curl to replicate and debug an issue

The generated curl command for this example would be: curl -v -X POST --header 'X-Custom: custom data' http://www.example.com -d '{"key":"value"}'

With this, you can test integrations and dig deeper. I suggest placing the generated curl in every error handling case dealing with an http request.

More Repositories

1

pester

Go (golang) http calls with retries and backoff
Go
644
star
2

multibar

Display multiple progress bars in Go (golang).
Go
377
star
3

curse

Basic terminal cursor manipulation
Go
49
star
4

fakettp

Command line http debugging proxy for faking http responses. Set response codes, headers, time to respond, and more
Go
48
star
5

Dapi

Dapi is an experiment in creating a database rest api geared towards MySQL in Go.
Go
5
star
6

httpsink

A simple http sink. Any endpoint that you call gets captured and the request data can be retrieved.
Go
5
star
7

memtest

MemTest is a terminal spot-the-difference game
Go
4
star
8

xeger

Xeger is an inverse regex generator. Pass in your regular expression pattern and get back a string that matches.
Go
3
star
9

giraffe

giraffe is an in-memory directional graph designed to model scaffolding knowledge relationships
Go
3
star
10

the_game

Playing around with a terminal based game (this is the server). see github.com/sethgrid/the_game_client
Go
2
star
11

multifilt

MultiFilt (and the cmd line tool mf) filter an input stream and drop lines that match lines in a filter file.
Go
2
star
12

MorseNode

Spaces missing in your Morse Code? Rebuild possible matching strings.
Python
2
star
13

countmyreps

Go
2
star
14

taskr

Log the tasks that you've done from the command line
Go
1
star
15

go_apid

Go
1
star
16

the_game_client

Playing around with a terminal based game (this is the client). see github.com/sethgrid/the_game
Go
1
star
17

interview_idea

An idea I am floating for interviews
Go
1
star
18

justify

playing around with justifying fixed width text
Go
1
star
19

exploit

An attempt at validating a curl | sh exploit
Go
1
star