How To Send A Post Request in Swift to Create A User

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024
  • How To Send A Post Request in Swift to Create A User
    🤙🏾 Subscribe to the tundsdev RUclips channel
    www.youtube.co...
    ⏭ Next Video
    How To Handle Networking Errors Handling In SwiftUI
    • How To Handle Networki...
    ⏮ Previous Video
    Passing data between views in SwiftUI to get our user details
    • Passing data between v...
    Ready to level up your SwiftUI skills?🚀
    Learn how to tackle take-home projects in SwiftUI, nail interviews, and more with this FREE course!📚
    This RUclips playlist teaches you everything you need know to land your first iOS role 🫂
    📹 • SwiftUI Take Home Proj...
    In this video, we'll look at how to send a POST request in Swift, so that we can create a user in our SwiftUI app using a Swift post request. We'll refactor our networking code, and look at the POST request HTTP method. This will allows us to see how to use get and post requests Swift.
    What is a REST API? (REST API Explained for beginners)
    • What is a REST API? (R...
    Breaking down Swift Generics (Swift Generics Basics)
    • Breaking down Swift Ge...
    How To Use Codable in Swift (Codable Swift)
    • How To Use Codable in ...
    Passing data between views in SwiftUI with Binding (SwiftUI Binding, Passing Data In SwiftUI)
    • Passing data between v...
    Breaking down the SwiftUI App Lifecycle (iOS App Life Cycle)
    • Breaking down the Swif...
    SwiftUI iOS Take Home Test Resources
    github.com/tun...
    SwiftUI iOS Take Home Test Course (Learn SwiftUI Online For Free, SwiftUI Free Online Course, iOS Dev Job Interview Practice - Take Home Project)
    • SwiftUI Take Home Proj...
    👦 SwiftUI Sessions - Beginners (Learn SwiftUI Online For Free, SwiftUI Free Online Course)
    • Learn SwiftUI From Scr...

Комментарии • 20

  • @samanthaeufrasiorocha3680
    @samanthaeufrasiorocha3680 2 года назад +3

    I really need the next part, please post it soon as possible. Amazing work, ty

    • @tundsdev
      @tundsdev  2 года назад

      Glad you enjoyed it & the next videos are coming up very soon

  • @valcollectsmoments1271
    @valcollectsmoments1271 Год назад +1

    Thank you! You have really great tutorials. It was very helpful

    • @tundsdev
      @tundsdev  Год назад

      That’s great to hear, glad you found it useful

  • @Ravikanth_007
    @Ravikanth_007 10 месяцев назад +1

    Thank you for covering post request also 👍🏼

    • @tundsdev
      @tundsdev  10 месяцев назад

      No problem 😊

  • @KimbrellBrad
    @KimbrellBrad 2 года назад +2

    Another great one TD! Can you explain the decision point where you decide to put add'l functionality into an extension rather than the body? Thanks for the great content!

    • @tundsdev
      @tundsdev  2 года назад +3

      Thanks & I just do it to break up configuration and keep things clean. There’s no performance boost its purely for organisation purposes 👌🏾

  • @coolcodingdad
    @coolcodingdad Год назад

    Hey Tunds, I'm getting a lot out of your course and feel like this will set me up nicely for any Take Home Project I have in the future. Just wondering about the encoding because JSON decoding is in the Network Manager, but the JSON encoding is in the View Model. Is this done because the JSON decoding has to happen after the GET, but the encoding needs to happen before it reaches the POST, or is there another reason? Thanks! 😸

    • @tundsdev
      @tundsdev  Год назад +1

      Purely for simplicity my man, didn’t want to overcomplicate the network manager. It could 100% be in the network manager but to achieve this i’d use generics. Maybe a lil challenge for you 🤝

    • @coolcodingdad
      @coolcodingdad Год назад

      ​@@tundsdev, thanks, and I will give that a try after this course! 😸

  • @shuntakahashi3275
    @shuntakahashi3275 2 года назад +1

    So nice!! Im looking forward to nexts🔥🔥

    • @tundsdev
      @tundsdev  2 года назад

      Thanks, glad you enjoyed it 👌🏾

  • @abdouett3676
    @abdouett3676 2 года назад +1

    Awesome job! Thank you!

    • @tundsdev
      @tundsdev  2 года назад

      Glad you enjoyed the content 👌🏾

  • @ousmanediouf8566
    @ousmanediouf8566 Год назад

    one doubt here if we are sending data over the network, why is the http method defined on the overloaded method is set to be a .GET instead of a POST(data)

    • @tundsdev
      @tundsdev  Год назад

      This is so you have a default, most times when you make a network request they’ll be GET requests. Rather than having to specify GET for every request it will be the default, you can then choose to override it with POST if you want to 👌🏾

  • @shuvayansaha2522
    @shuvayansaha2522 2 года назад

    Hi, getting this error on view when write on change method - > Instance method 'onChange(of:perform:)' requires that 'ViewModelImpl.State' conform to 'Equatable'

    • @tundsdev
      @tundsdev  2 года назад +1

      Hi, i’m not too sure if you changed the enum to have associated values. Cos enums without them get equatable conformance automatically which why i don’t need to add it.
      For your issue you need to add “enum SubmissionState: Equatable {…” and then if it asks you to add missing protocols then you’ll need to do something like this, hope this helps.
      medium.com/@aainajain/equatable-for-enum-with-associated-value-e07d9ab20e8e

    • @shuvayansaha2522
      @shuvayansaha2522 2 года назад +1

      @@tundsdev Yes, I am passing data through enum case, that's why it is not worked, now I am changing my code as per your suggestion , Its working now, Thank you for your great help. 👏