3

Is there a way to copy the HTTP request as a curl command (colloquially, "copy as curl") or to replay it from the network developer tools for Flutter?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Divakar Rajesh
  • 1,140
  • 2
  • 18
  • 23

2 Answers2

5

The latest devtools versions should have the copy-as-curl functionality. See the PR here.

See also the feature request issue that the above PR closed: feature request: copy http request "as curl" #3042

According to the CHANGELOG the feature was released in version 2.14.0, so in theory you just have to upgrade to that or any later version, and you'll have Copy as URL and Copy cURL.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Marcell Toth
  • 3,433
  • 1
  • 21
  • 36
1

As far as I know, you cannot copy a request as curl in dev tools. If you use Dio, you can intercept the Dio request with this package and get an HTTPS request as a curl string printed in the console. Then you can use Postman to replay it.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Gowtham K K
  • 3,123
  • 1
  • 11
  • 29