Skip to content

Add optional flag in generation process to add the following http2curl call after every request. #3606

Open
@wbatwb

Description

Hello! As part of how I run things in my team, I like to have the option to enable a debug output that spits curl calls for every request out to the standard output of the machine. Here's an example of what this looks like. It would be quite simple to add this to the code generation process, and would even be a great option for somebody new to Open Source to complete.

The specification I suggest is the following.

Some mechanism for generating with http2curl should change a generation in goa to the following

  1. add http2curl as a dependency if there is a request in the file. Replace any request generation with the following workflow
  2. Add http2curl before the request
  3. Add http2curl after the request

its not clear which of the above would be better.

But I think this would be awesome because:

  1. it's optional.
  2. it doesn't initially sound too difficult to achieve.
  3. For our use case, lets us export and debug beginning with the http request for failures since postman lets you import curl.
  4. http2curl is just a couple lines so this is not something you need any other development for

command, _ := http2curl.GetCurlCommand(req) fmt.Println(command) //Send Request right before or after any instance of response, err := http.Client.Do(req)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions