0

I'm running a flutter desktop app on linux and i need get the response from the following curl request

curl -sS --unix-socket /run/snapd.socket http://localhost/v2/snaps/ -X GET

I've got the process_run package installed so making the call is fairly straightfoward, i just dont know how to get the response from the call in to my dart code.

markusrambarkus
  • 412
  • 1
  • 5
  • 12
  • There's a few options but I won't provide an answer because I'm not familiar with the `process_run` library. The results of a `runExecutableArguments` is a [`ProcessResult`](https://api.dart.dev/stable/2.13.3/dart-io/ProcessResult-class.html). From the `ProcessResult` you can read the `stdout` value (it will be as a String object), then try parsing it into an actual response. – Apealed Jun 22 '21 at 14:34
  • Alternatively, you can use the [`http`](https://pub.dev/packages/http) package to make the GET request directly in Dart code. – Apealed Jun 22 '21 at 14:36

0 Answers0