Menu

Post image 1
Post image 2
1 / 2
0

Low Level HTTP Client in Dart

DEV Community·Mathieu K·22 days ago
#Jf71oCCp
#dart#http#client#webdev#fullscreen#httpcat
Reading 0:00
15s threshold

Dealing with HTTP requests is also learning a lot about network issues and distributed data problems. Indeed, HTTP requires a connection, it can be a local one (useful only if you want to test or deal with private stuff) or a remote one (way better to fetch data from the web). Dart offers a low-level interface to an HTTP Client called HttpClient . It could be nice to try it first and then find a decent alternative like the http package . Let call this new project httpcat a small command line HTTP client. The idea is to simple create a connection to a remote server and print the returned data with the headers. here an example: $ httpcat ${ target } Enter fullscreen mode Exit fullscreen mode Where ${target} is a valid URL using HTTP or HTTPS protocol. dart create httpcat cd httpcat Enter fullscreen mode Exit fullscreen mode Let create a new project from scratch with dart create command and start edit the entry-point in bin/httpcat.dart .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More