User Login With AFNetworking

后端 未结 3 1111
耶瑟儿~
耶瑟儿~ 2021-01-22 02:57

I am building my first iOS app.

I have got the backend code done, but I am struggling with the Objective-C part of it.

I have a signup / login page.

But

3条回答
  •  太阳男子
    2021-01-22 03:35

    Since you're trying to login to your own API, you don't want setAuthorization stuff. That's for basic HTTP auth. Instead you want to use getPath:parameters:success:failure or the postPath version, depending on if your backend is expecting HTTP GET or HTTP POST.

    Pass your userid / password in the parameters argument. You should set parameterEncoding to be the correct format. You're probably using HTTP Forms url encoding, or JSON. Whatever your backend expects.

提交回复
热议问题