forked from mholt/curl-to-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
43 lines (36 loc) · 1.88 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<title>curl-to-Go: Convert curl commands to Go code</title>
<meta charset="utf-8">
<script src="resources/js/jquery.min.js"></script>
<script src="resources/js/highlight.pack.js"></script>
<script src="resources/js/curl-to-go.js"></script>
<script src="resources/js/common.js"></script>
<script src="https://mholt.github.io/json-to-go/resources/js/json-to-go.js"></script>
<link rel="stylesheet" href="resources/css/color-brewer.css">
<link rel="stylesheet" href="resources/css/common.css">
</head>
<body>
<header>
<h1>curl-to-Go</h1>
<h2>Instantly convert <a href="http://curl.haxx.se/">curl</a> commands to <a href="https://golang.org/">Go</a> code</h2>
<p>
This tool turns a curl command into Go code. (To do the reverse, check out <a href="https://github.com/sethgrid/gencurl">sethgrid/gencurl</a>.) Currently, it knows the following options: -d/--data, -H/--header, -I/--head, -u/--user, and -X/--request. It also understands JSON content types. As always, be sure to <code>go fmt</code> your code and pay attention to imports. There's probably bugs; please <a href="https://github.com/mholt/curl-to-go">contribute on GitHub</a>! For a quick way to generate a Go struct from JSON, see <a href="https://mholt.github.io/json-to-go">JSON-to-Go</a>.
</p>
<p class="examples">
<a href="javascript:" id="example1">Example 1</a> ·
<a href="javascript:" id="example2">Example 2</a> ·
<a href="javascript:" id="example3">Example 3</a> ·
<a href="javascript:" id="example4">Example 4</a> ·
<a href="javascript:" id="example5">Example 5</a>
</header>
<main>
<textarea id="input" rows="4" placeholder="Paste curl here"></textarea>
<div id="output"></div>
</main>
<footer>
© 2016 Matt Holt - <a href="https://github.com/mholt/curl-to-go">View on GitHub</a>
</footer>
</body>
</html>