0

https://dartfrog.vgv.dev/docs/tutorials/todos#summary I got to this section, but I don't know how to get it to work at the end, so I can't get it to work.

in my browser

http://localhost:8080/todos

When I access the above url, [] is displayed, so I think it's working.


# Update a specific todo by id
curl --request PUT \
  --url http://localhost:8080/todos/<id> \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "Take out trash!",
  "isCompleted": true
}'

How can I check that the above part works?

Mike Johan
  • 25
  • 3

1 Answers1

0

The line you see there is a command you are supposed to run on your commandline.

If you use a newer version of windows you probably have curl already, if not, see How do I install and use cURL on Windows?

So you open your command prompt and enter

curl --request PUT --url http://localhost:8080/todos/<id> --header 'Content-Type: application/json' --data '{ "title": "Take out trash!", "isCompleted": true }'

where I guess the <id> part needs to be an id. So for example 1.

Please note that that is a tutorial for a backend in Dart. They are not commonly called an app. If you are looking to build a nice app for your device or webbrowser, with ui controls like input boxes and buttons, you are reading the wrong tutorial.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
  • Thank you for your reply. Looks like I didn't realize it already worked. I would like to proceed with the package selection according to your advice. – Mike Johan Feb 04 '23 at 07:03