Open gopuneet opened 1 year ago
After going through the code, I think the issue can be fixed near the above code block by adding:
data = args.data
if data is not None and args.request != 'POST':
args.request = 'POST'
# rest same from Line 469
Cool, thanks for the find, keeping consistency with curl make it very convenient - please send PR
Using
-d
arg doesn't automatically make the request method POST and sends a GET request which is unexpected behaviour sincecurl
automatically makes the method POST when using-d
arg (Refer curl -d manpage & curl tutorial example for post).Reproducible Example
Here, we are using Neptune Statistics API which uses the same endpoint for getting status, disabling/enabling autoCompute, manually triggering stats generation etc.
-d
is specified so it should automatically become a POST request but a GET request is sent which can be verified by adding-v
)-X POST
)