Open steve-r-west opened 2 years ago
An example might be if the first command is POST /v2/customers
then the output of logs curl-replay 1
should be:
curl -X POST "https://api.moltin.com/v2/customers" \
-H "Authorization: Bearer $(curl https://api.moltin.com/oauth/access_token -d ... | jq .)"
-H "Content-Type: application/json"
-d '{data:{"name":"Ron Swanson", "email":"ron@swanson.com"}}'
Though this is incomplete.
In #79 we added support for showing the list of HTTP requests. In #116 we sanitized a lot of them. We should let users generate a curl command to replay a request.
Acceptance Criteria
logs curl-reply N
command, if an Nth command exists, a curl call is outputted that should replay the command.Bearer
token should be replaced with a nested curl and jq command that generates a new token based on the environment variable values.:bulb: You can ask Steve for some example code he has to convert an HTTP request into a curl command.