No video

Fetching Data from API | Part - 2 | HTTP get Request in Flutter | Hindi

  Рет қаралды 46,252

Ahirlog

Ahirlog

Күн бұрын

To fetch data from an API in a Flutter app, you can use the http package, which provides a simple and efficient way to make HTTP requests and receive HTTP responses.
Here is an example of how you might use the http package to fetch data from an API in a Flutter app:
import 'package:http/http.dart' as http;
// Make a GET request to the API
final response = await http.get('example.com/ap...
// Check the status code of the response
if (response.statusCode == 200) {
// If the request was successful, parse the JSON data
final data = json.decode(response.body);
// Use the data as needed
} else {
// If the request was unsuccessful, throw an error
throw Exception('Failed to fetch data');
}
In this example, the http.get function is used to make a GET request to the API, and the response object is used to hold the response from the server. The statusCode property of the response object is used to check whether the request was successful or not, and the body property is used to hold the data returned by the server.
You can also use the http package to make other types of HTTP requests, such as POST, PUT, and DELETE, by using the http.post, http.put, and http.delete functions, respectively.
Blog: www.ahirlog.co...
My KZfaq Gear:
Boya BYM1(Mic): amzn.to/3bvm69j
Redmi Note 7 Pro(Mic & Camera): amzn.to/3uRkVsb
MSI Motherboard: amzn.to/3fiQHYO
Intel i3 Processor: amzn.to/3w8TWbQ
Mouse: amzn.to/3yb8PMP
Keyboard: amzn.to/3bvmtkd
Wifi Adaptor: amzn.to/3fiQYuO
SSD: amzn.to/3w2w2Pa
Speakers: amzn.to/3w6pKhv
Instagram: / ahirlog
Facebook: / ahirlog
Twitter: / ahirlog
KZfaq: / ahirlog
#ahirlog #flutter #dart
Last Summer by Ikson: / ikson​
Music promoted by Audio Library • Last Summer - Ikson (N...

Пікірлер: 57
@avilashbhowmik3995
@avilashbhowmik3995 8 ай бұрын
The way of your explaination, was really great as usual. Thanks a lot brother.
@vinit_972
@vinit_972 Жыл бұрын
My friend Axit kapadiya is only depended on your you tube channel
@yashvadher-xn5qq
@yashvadher-xn5qq Жыл бұрын
hmm you are right
@ajitmkapadiya6593
@ajitmkapadiya6593 Жыл бұрын
javadey loda (tu youtube karato ho atale badha no karata hoy ky
@aakashgaming8659
@aakashgaming8659 Жыл бұрын
great video bro i got errors in my code but after watching this video .I have solve errors in my code thanks you bro .
@ahirlog
@ahirlog Жыл бұрын
Thank you
@Anillucky25
@Anillucky25 6 ай бұрын
hello bhai, thanks for this video the way of explaining is very easy to understanding and good and expecting more API's like post, put patch method. it's really appreciate thanks.
@hemanshpandya765
@hemanshpandya765 Жыл бұрын
brother very good for beginners
@hassamkayani2521
@hassamkayani2521 Жыл бұрын
Plz make a view of API Post Method ....Boht acha samjty ho bhai ap ...Love from Pakistan
@ahirlog
@ahirlog Жыл бұрын
Thank you
@hassamkayani2521
@hassamkayani2521 Жыл бұрын
@@ahirlog plz Brother Api k Post b karwa do..plz
@hassamkayani2521
@hassamkayani2521 Жыл бұрын
@@ahirlog agr ap ny already video upload ki hoi hye to Mujy link day do ma dakh leta hu
@ahirlog
@ahirlog Жыл бұрын
I will make
@FunGamerz-786
@FunGamerz-786 Жыл бұрын
thank you very much ahirlog this video
@ahirlog
@ahirlog Жыл бұрын
Thank you too
@Second_zoneHandler
@Second_zoneHandler 10 ай бұрын
yeh same apan Provider se bhi kar sakte hai instead of listviewbuilder right?
@user-eh4fm7uq6w
@user-eh4fm7uq6w Ай бұрын
Please bring State Management course
@ak4me
@ak4me Жыл бұрын
exact the same code but circle is rotation all the time
@someshsahu4638
@someshsahu4638 Жыл бұрын
Nice video thankyou 🙏🏼
@ahirlog
@ahirlog Жыл бұрын
Thank you too
@shivamnexvlogs7986
@shivamnexvlogs7986 Жыл бұрын
please make a video on post and put and delete method of http for api
@ahirlog
@ahirlog Жыл бұрын
ok
@shortcasthub091
@shortcasthub091 Жыл бұрын
hey bro i found this error while fetching data, will you please help me to fix this error _TypeError (type '_InternalLinkedHashMap' is not a subtype of type 'Iterable')
@ahirlog
@ahirlog Жыл бұрын
Use type cast as List or use .toList
@alaaabdullah2648
@alaaabdullah2648 Жыл бұрын
@@ahirlog can you please explain where should I add .toList
@13soulmate13
@13soulmate13 Жыл бұрын
Type error string dynamic is not a sub type of type itrable bro pls solve
@ahirlog
@ahirlog Жыл бұрын
I will make video on this
@hisamsikder9555
@hisamsikder9555 Жыл бұрын
how to add webview inside a button . when i click that button it open webview
@ahirlog
@ahirlog Жыл бұрын
Ok
@mekaamrutha7213
@mekaamrutha7213 7 ай бұрын
Iam getting errors In home_page.dart,how can i modifying
@Beavers-v9y
@Beavers-v9y 7 ай бұрын
Thanku bhai
@moizahmed5372
@moizahmed5372 Жыл бұрын
ty
@BasantKumar-bg3fg
@BasantKumar-bg3fg Жыл бұрын
here you are showing data from jsonarray, please can you help me to get jsonobject from api by button click and show in text widget ?
@ahirlog
@ahirlog Жыл бұрын
ok
@Wardatu4
@Wardatu4 8 ай бұрын
It's http or api
@shekhawat999mohit
@shekhawat999mohit 3 ай бұрын
bhai aawaj kam h thodi
@PriyaSingh-do3qg
@PriyaSingh-do3qg Жыл бұрын
Post api ki video bana dijiye
@ahirlog
@ahirlog Жыл бұрын
ok
@ctvtechno4992
@ctvtechno4992 Жыл бұрын
how to upload images
@ahirlog
@ahirlog Жыл бұрын
will upload
@kainatnaeem2604
@kainatnaeem2604 Жыл бұрын
I want to fetch questions an answers from stackoverflow could you please guide
@ahirlog
@ahirlog Жыл бұрын
I am not sure about stack overflow, but I think if they provide api for then you use that api and fetch the data
@HelloWorld-tx4qn
@HelloWorld-tx4qn Жыл бұрын
i need some help
@ahirlog
@ahirlog Жыл бұрын
What
@snehdeepukey1279
@snehdeepukey1279 Жыл бұрын
SIr aapka contact detail share karo na
@dushyantsharma2415
@dushyantsharma2415 Жыл бұрын
how to fetch nested api its difficult bro please reply
@ahirlog
@ahirlog Жыл бұрын
make a video on this
@vickramkumar9005
@vickramkumar9005 Жыл бұрын
bhai awaaz badhao sunai he nahi deti aap ki awaaz
@ahirlog
@ahirlog Жыл бұрын
Ok
@ahirlog
@ahirlog Жыл бұрын
Use headphone
@parvejchhipa4253
@parvejchhipa4253 Жыл бұрын
http pakage ki jagh dio use karna kesa haiiiii....
@ahirlog
@ahirlog Жыл бұрын
You can use it
@OwaisKhan-dm8vb
@OwaisKhan-dm8vb Жыл бұрын
Vdo quality is poor
@ahirlog
@ahirlog Жыл бұрын
Now you can check
@ankitnagar9184
@ankitnagar9184 Жыл бұрын
Type error string dynamic is not a sub type of type itrable bro pls solve
@ahirlog
@ahirlog Жыл бұрын
Use .tolist or type cast
01  Flutter API call | Flutter REST API Series
11:40
Nitish Kumar Singh
Рет қаралды 130 М.
Nurse's Mission: Bringing Joy to Young Lives #shorts
00:17
Fabiosa Stories
Рет қаралды 4,1 МЛН
Пройди игру и получи 5 чупа-чупсов (2024)
00:49
Екатерина Ковалева
Рет қаралды 4,2 МЛН
Matching Picture Challenge with Alfredo Larin's family! 👍
00:37
BigSchool
Рет қаралды 47 МЛН
Parenting hacks and gadgets against mosquitoes 🦟👶
00:21
Let's GLOW!
Рет қаралды 13 МЛН
REST Call with Flutter - Http methods
19:55
CodeX
Рет қаралды 70 М.
Top 30 Flutter Tips and Tricks
6:50
Flutter Mapp
Рет қаралды 551 М.
Flutter Api Calling and JSON Parsing using Dio and Json Serializable
1:04:33
REST API with Flutter | Step by step tutorial
11:10
CodeX
Рет қаралды 160 М.
Nurse's Mission: Bringing Joy to Young Lives #shorts
00:17
Fabiosa Stories
Рет қаралды 4,1 МЛН