fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.36k stars 497 forks source link

Too many arguments error #334

Closed asador closed 1 year ago

asador commented 1 year ago

Using GO 1.19 on Windows and it fails with "Too many arguments" error when calling with -d flag

C:\Users\dev>go version
go version go1.19 windows/amd64

C:\Users\dev>grpcurl -d '{"locId": 1}' -plaintext localhost:8980 my.Service/GetLocation
Too many arguments.
Try 'grpcurl -help' for more details.   
jhump commented 1 year ago

This is a duplicate of #195.

@asador, please see that other issue for a resolution. The problem is that the Windows command tool/shell does not support quoting/escaping in the way that other modern shells do. So it sees the space in your request body (between the colon and the numeral 1) and thinks those are two different arguments, despite them being enclosed in single quotes.

asador commented 1 year ago

Thanks. That was it.

xunxky commented 7 months ago

since my google search led me here.
In my case I am not on windows but did use the wrong order of arguments.