REST Call with Flutter - Http methods

Sdílet
Vložit
  • čas přidán 12. 09. 2022
  • In this detailed tutorial we will learn how to perform GET, POST, PUT and DELETE Http operations using Flutter.
    All the methods are implemented with BaseClient so you can use across application for any functionality.
    If you like my work
    Support Me on Ko-Fi : ko-fi.com/afzalali15
    Git Source:
    github.com/afzalali15/HTTP-Me...
    Join this channel to get access to perks:
    czcams.com/users/CodeXDevjoin
    Gears ========
    Camera 📸 || Canon 250D : amzn.to/34isdKr
    Mic 🎤 || Maono AU-04 : amzn.to/341g9wS
    #CodeX
    Connect with me on social media:
    FB: / codexdevs
    Twitter: / afzalali_dev
    LinkedIn: / afzalali15
    Discord: / discord

Komentáře • 68

  • @mageshkanna
    @mageshkanna Před rokem +1

    Best explanation in CZcams ❤️
    You made my day easier 💥

  • @BeaconofHopeNetwork
    @BeaconofHopeNetwork Před rokem +6

    Thanks. This is what i need for my project

  • @giulianocapovilla2136

    hi, thank u so much for the tutorials, im new in flutter and this is perfect for me, i was working with java and api rest, i wanted a chanched, so thank u

  • @asondubuisi5807
    @asondubuisi5807 Před rokem

    This is awesome. I'll be implenting this with the nodejs api I built

  • @justbe_joe9765
    @justbe_joe9765 Před rokem +2

    I honestly learned a lot of what i needed here
    thank you. Thank you Codex

    • @CodeXdev
      @CodeXdev  Před rokem

      Appreciate it! Subscribe n share 😍

  • @menushichandima3002
    @menushichandima3002 Před 29 dny

    Best explanation with code.

  • @abdmo7575
    @abdmo7575 Před rokem

    finally i found a clear explanation for this! thanks
    can you explain authentication/authorization by jwt token?

  • @sa_lihrecords8687
    @sa_lihrecords8687 Před rokem

    thanku bro...from kerala

  • @Flutter_TH
    @Flutter_TH Před rokem

    this is the best Video help full

  • @sale7680
    @sale7680 Před rokem

    Bravo man ❤

  • @rowleyes5954
    @rowleyes5954 Před rokem

    thank you very much

  • @adolfusadams4615
    @adolfusadams4615 Před rokem +7

    Can you do a tutorial on how to use GraphQL with Flutter?

  • @dev.ibrahim419
    @dev.ibrahim419 Před rokem +1

    Great Work Brother , Can you help me with an example how to use the data returned from post request in future builder.

  • @akhil17able
    @akhil17able Před rokem

    Thank you yaar.

  • @fetouhsadegh9368
    @fetouhsadegh9368 Před rokem

    hello to solve the probleme where the get methode work but post and put does nt read this :
    the problem is from the header ,in the put and post you need the header atribute in the request core,.
    you dont need the same as in the video since you probably don t have the autorisation nor the api_key as in the first declaration at 3:57 but you need the content type atribut in the header, so you header variable should look like the one at 13:31 if you follow the video you will see he have a problem too before he add it so basicly you need your header variable to be :
    var _headers = {
    'Content-Type': 'application/json',
    };
    again you can have api key autorisation and more stuff ,but so it just work the presence of content type atribut with the value aplication/json (like the code juste above) is enough.
    i hope this helped .

  • @kadidibwa968
    @kadidibwa968 Před rokem +1

    Never assume we would get bored

  • @flutterdev2930
    @flutterdev2930 Před rokem +1

    Can u make api integration using dio package

  • @sale7680
    @sale7680 Před rokem

    You send api parameters
    When u use
    For using route dynamically
    ?

  • @rolferikson
    @rolferikson Před rokem

    I cannot print data like users[1].name. Is users not a list? What shall I do for reading data?

  • @Vamp007
    @Vamp007 Před rokem +1

    Please make a tutorial on graphQL with flutter

  • @poetryiscodingdecoding7965

    Please explain more on headers it is important aspect

  • @kunalmanshani379
    @kunalmanshani379 Před 10 měsíci

    hello sir, can you please make a video on api handling architecture for large project.

  • @poetryiscodingdecoding7965

    Sir, I have made my own api and it uses bearer token authentication how should I use it ...i am unable to make a request for the same

  • @sumanth862
    @sumanth862 Před rokem

    what is that api_key you have passed in headers?

  • @lbarria11
    @lbarria11 Před rokem

    Hola, una consulta en el metodo get mi endpoint recibe un api_ke y ciertos parametros, como puedo agragarlo en la construccion del url como se hace con los headers y no agrgarselo al final de mi metodo despues del url. Saludos

    • @CodeXdev
      @CodeXdev  Před rokem

      No necesita pasar API_Key como parámetro.
      Por lo general, las api_keys se almacenan en variables globales y debe pasarlas directamente en el parámetro de encabezado de cualquier solicitud.

  • @muhammaddede4615
    @muhammaddede4615 Před rokem

    How to implement post multipart sir?

  • @devprasad8767
    @devprasad8767 Před rokem +1

    Can u make a video on riverpod

  • @jaiminkoshti6595
    @jaiminkoshti6595 Před rokem +1

    make tutorial on retrofit + getx + api (GET , POST , PUT , DELETE)

  • @jayisampelliwar5065
    @jayisampelliwar5065 Před rokem +2

    Hi Afzal sir,
    i used the same API and try to CURD operations but while making the get req. is working fine, but when i going to do PUSH, PUT and DELETE it's thowing an error.
    E/flutter (16462): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type '(dynamic) => User' is not a subtype of type '(String, dynamic) => MapEntry' of 'transform'
    I try to fix but i can't make it. so sir can you tell me what's going wrong here and used the same Model class as you.

    • @CodeXdev
      @CodeXdev  Před rokem +1

      With dynamic types, you need to be careful of what data you are parsing back. May be your return type is mismatching.
      You can share details on Discord channel and will try to help you out.

    • @jayisampelliwar5065
      @jayisampelliwar5065 Před rokem

      @@CodeXdev thank you sir

    • @byiringirooscar321
      @byiringirooscar321 Před rokem

      hello bro is your issues fixed ? even me I have this errors

    • @jayisampelliwar5065
      @jayisampelliwar5065 Před rokem

      @@byiringirooscar321 yes, my issue is fixed

    • @byiringirooscar321
      @byiringirooscar321 Před rokem

      @@jayisampelliwar5065 please can you help me I have the same of your errors

  • @AninArafath
    @AninArafath Před rokem

    ❤️❤️

  • @mohamedshifanmohamedkulans90

    Flutter Autocomplete with arrow keyboard navigation is not working please help me

    • @CodeXdev
      @CodeXdev  Před rokem

      Autocomplete supports keyboard out of the box, what issue you are facing exactly ?

  • @uniquevideos4740
    @uniquevideos4740 Před rokem

    *We see that body is exist and login with post request but i want login with get request not post, please tell me how i can*

    • @CodeXdev
      @CodeXdev  Před rokem

      GET request you can pass param like this 👇🏼
      api/login?username='test'&password='encrypted_pass'&device='iOS'
      Its not recommended to pass confidential data in the GET request, its should only be used to fetch public data, something like this,
      api/getCities?countryId=123

    • @uniquevideos4740
      @uniquevideos4740 Před rokem

      i get response body but when i display response like id name then it dose not display it show error null its not a string or string is not a subtype of int can you tell me solution

  • @justbe_joe9765
    @justbe_joe9765 Před rokem +1

    I am a junior developer who started out with dart
    and i am having a little bit of issues with 'Logic' when using api's can you refer a tutorial or guide sir ?
    Thank you for your consideration

    • @CodeXdev
      @CodeXdev  Před rokem

      Hi, you can check this video czcams.com/video/c09XiwOZKsI/video.html

  • @AshishKumar-jo4fo
    @AshishKumar-jo4fo Před rokem

    sir please make a video on how to call api USING GETX model view controller for like below response in which we can access status as well as data array
    {
    "isSuccess": true,
    "datacount": 77,
    "data": [
    {
    "provinceID": 1,
    "provinceNameEN": "Bangkok",
    "geoID": 2
    },
    {
    "provinceID": 2,
    "provinceNameEN": "Samut Prakan",
    "geoID": 2
    }
    ],
    "error": {
    "code": null,
    "messageToDeveloper": null,
    "messageToUser": null
    }
    }

  • @shaikhurooj8441
    @shaikhurooj8441 Před rokem

    Sir pls make tutorial on authenticatin mobile otp with rest api in flutter

  • @zainhaidernaqvi5171
    @zainhaidernaqvi5171 Před rokem

    how to hide the installed application in flutter ( android )

    • @CodeXdev
      @CodeXdev  Před rokem

      I don't think it can be done, its OS capability...

  • @veeralavan2372
    @veeralavan2372 Před rokem

    Super Bro👍, How to cancel the (previous) api request

    • @CodeXdev
      @CodeXdev  Před rokem

      Its something dart doesn't provide out of the box. We can not cancel Future easily.
      There are some tweaks or custom implementation, which is topic for another tutorial.

  • @Gopinath-kk2fi
    @Gopinath-kk2fi Před rokem

    Bro I'm getting CORS error it's showing xml http error, please help me to sort out this error.

    • @CodeXdev
      @CodeXdev  Před rokem +1

      Hello, CORS error comes because of the restriction on your server side. Are you using the same API in this video or other?

    • @Gopinath-kk2fi
      @Gopinath-kk2fi Před rokem

      @@CodeXdev yeah bro I'm using third party api for my learning project even it's a open api, when we call in postman it will work properly and with help of flutter_Cors package we can get proper response in local but in production ( after deploy in firestore) it's showing xmlRequestError in network console cors error. Could you please help me.....

    • @Gopinath-kk2fi
      @Gopinath-kk2fi Před rokem

      @@CodeXdev thank you for your response..

  • @darshitkaklotar9003
    @darshitkaklotar9003 Před rokem

    Flutter more concept video uploaded

  • @mrsp7693
    @mrsp7693 Před rokem

    Brother Rest API Steam Chat is working passable

    • @mrsp7693
      @mrsp7693 Před rokem

      Sorry Stream Bulider

    • @CodeXdev
      @CodeXdev  Před rokem

      Yes, it’s possible.. You will listen to stream for response

    • @mrsp7693
      @mrsp7693 Před rokem

      I am Stat management provide using brother

    • @mrsp7693
      @mrsp7693 Před rokem

      Using Stream Bulider in Chat my try full failure so please help

  • @Harry-ju9nv
    @Harry-ju9nv Před rokem

    sorry sir , i messed up your api

  • @imobcode707
    @imobcode707 Před rokem

    Wait wait wait,,, What he just said, "A Kofi Channel"??? Like he has another channel, Is it???

    • @CodeXdev
      @CodeXdev  Před rokem +1

      No 😝 KoFi is payment service, for tip and support ❤️

  • @abishekab21
    @abishekab21 Před 3 měsíci +3

    not for beginners