async run()

in src/commands/util/curl.ts [29:42]


  async run() {
    const { args, flags } = await this.parse(UtilCurl)

    const maybeUrl = new Try(() => new URL(args.url))

    if (!maybeUrl.isSuccess) {
      this.error(`${args.url} is not a valid url`, { exit: 1 })
    }

    const http = this.http!

    const response = await http.request(flags.method, args.url, flags.data)
    this.log(JSON.stringify(response))
  }