-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgenerated.usage.txt
46 lines (40 loc) · 5.3 KB
/
generated.usage.txt
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
44
45
46
protocurl <version>, build <hash>, https://github.com/qaware/protocurl
protoCURL is cURL for Protobuf: The command-line tool for interacting with Protobuf over HTTP REST endpoints using human-readable text formats.
Usage:
protocurl [flags] -I proto-dir -i request-type -o response-type -u url -d request-text
It uses 'curl' from PATH. If none was found, it will fall back to an internal non-configurable http request.
It uses a bundled 'protoc' (by default) which is used to parse the .proto files.
The bundle also includes the well-known Google Protobuf files necessary to create FileDescriptorSet payloads via 'protoc'.
If the bundled 'protoc' is used, then these .proto files are included. Otherwise .proto files from the system-wide include are used.
The Header 'Content-Type: application/x-protobuf' is set as a request header by default. (disable via -n)
When converting between binary and text, the encoding UTF-8 is always used.
When the correct response type is unknown or being debugged, omitting -o <response-type> will attempt to show the response in raw format.
Enhancements and bugs: https://github.com/qaware/protocurl/issues
Examples:
protocurl -I my-protos -i package.path.Req -o package.path.Resp -u http://example.com/api -d "myField: true, otherField: 1337"
Flags:
--curl Forces the use of curl executable found in PATH. If none was found, then exits with an error.
-C, --curl-args string Additional cURL args which will be passed on to cURL during request invocation for further configuration. Also activates --curl.
--curl-path string Uses the given path to invoke curl instead of searching for curl in PATH. Also activates --curl.
-d, --data-text-or-file string The payload data in Protobuf text format or JSON supplied as a string or a filepath (if first character is '@'). The string is inferred from the input as JSON if the first token is a '{'.The format can be set explicitly via --in. Mandatory if request-type is provided.See https://github.com/qaware/protocurl
--decode-raw Decode the response into textual format without the schema by only showing field numbers and inferred field types. Types may be incorrect. Only output format text is supported. Use -o <response-type> to see correct contents.
-D, --display-binary-and-http Displays the binary request and response as well as the non-binary response headers.
-h, --help help for protocurl
--in string Specifies, in which format the input -d should be interpreted in. 'text' (default) uses the Protobuf text format and 'json' uses JSON. The type is inferred as JSON if the first token is a '{'.
-F, --infer-files Infer the correct files containing the relevant protobuf messages. All proto files in the proto directory provided by -I will be used. If no -f <file> is provided, this -F is set and the files are inferred.
-X, --method string HTTP request method. POST and GET are explicitly supported. Other methods are passed on to curl optimistically. (default "POST")
--no-curl Forces the use of the built-in internal http request instead of curl.
-n, --no-default-headers Default headers (e.g. "Content-Type") will not be passed to curl. Assumes --curl. Use "-n -H 'Content-Type: FooBar'" to override the default content type.
--out string Produces the output in the specified format. 'text' (default) produces Protobuf text format. 'json' produces dense JSON and 'json:pretty' produces pretty-printed JSON. The produced JSON always uses the original Protobuf field names instead of lowerCamelCasing them.
-I, --proto-dir string Uses the specified directory to find the proto-file. (default "/proto")
-f, --proto-file string Uses the specified file path to find the Protobuf definition of the message types within 'proto-dir' (relative file path).
--protoc Forces the use of a global protoc executable found in PATH or via --protoc-path instead of using the bundled one. If none was found, then exits with an error.
--protoc-path string Uses the given path to invoke protoc instead of searching for protoc in PATH. Also activates --protoc.
-H, --request-header string Adds the string header to the invocation of cURL. This option is not supported when --no-curl is active. E.g. -H 'MyHeader: FooBar'.
-i, --request-type string Message name or full package path of the Protobuf request type. The path can be shortened to '..', if the name of the request message is unique. Mandatory for POST requests. E.g. mypackage.MyRequest or ..MyRequest
-o, --response-type string The Protobuf response type. See -i <request-type>. Overrides --decode-raw. If not set, then --decode-raw is used.
-q, --show-output-only Suppresses all output except response Protobuf as text. Overrides and deactivates -v and -D. Errors are still printed to stderr.
-s, --silent Suppresses all output on stdout. Overrides and deactivates -v, -D and -q. Errors are still printed to stderr.
-u, --url string Mandatory: The url to send the request to
-v, --verbose Prints version and enables verbose output. Also activates -D.
--version version for protocurl