Skip to content

Support more input types in convert() function #35

@raghavbhatia336

Description

@raghavbhatia336

I am working on a new command newman request that will enable newman’s users to send a single request and show the request/response using a reporter of their choice. Here is the PR and it is work in progress.
Since newman request is the drop-in replacement of curl, it will support same options as curl command. I want to use curl-to-postman capabilities to create the Postman collection out of these curl options.

Currently, the convert() function only accepts string as the input type.

Since the options are already parsed in newman command, it is a bit of overhead to create a stringified curl command out of it.

I was discussing with GSoc mentors if we could add a functionality to the curl-to-postman library so that we can pass the already parsed curl options. One of the ways which I tried is by adding a new input type to convert() function. After this change, the convert() function is able to accept input in the following format:

{
  type: "curl-options",
  data: {
    request: "GET",
    url: "https://google.com",
    headers: [],
  }
}

The field names in data are the names of curl options in long notation.
Before doing this change, I wanted to get some feedback from the curl-to-postman community about this idea. I want to make it more aesthetically pleasing and also architecturally neat. Looking forward to your suggestions and discussion regarding this.

Metadata

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