grpcurl icon indicating copy to clipboard operation
grpcurl copied to clipboard

Too many arguments error

Open asador opened this issue 2 years ago • 2 comments

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.	

asador avatar Sep 02 '22 17:09 asador

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.

jhump avatar Sep 07 '22 13:09 jhump

Thanks. That was it.

asador avatar Sep 07 '22 14:09 asador

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

xunxky avatar Nov 15 '23 14:11 xunxky