dtr32221 2013-01-20 08:07
浏览 59
已采纳

响应为iOS应用程序开发的php(Magento)Web服务的Http状态代码

I am developing a iOS app like eBay. For this web service developer is using Magento. He developed the web service for Login. Following are the situations :

1) If I send valid login credentials , he returns me logged in used info in response + a flag as result = true & in this case http status code is 200.

2) If I send wrong password , he returns me a flag as result = false & http status code is 200.

Basically I don't want to depend on result flag because , if developer changed the result flag name then iOS app can't recognize that. So I want to follow standards which is a http status codes.

My question is , in 2nd situation is it right to send 200 as http status code ? I think he should send me 401 ? Correct me if I am wrong. If I am right , is there any way to send http status code from php code so that I can check the http status code on iOS side ?

  • 写回答

2条回答 默认 最新

  • doulingzou1712 2013-01-20 08:19
    关注

    My question is , in 2nd situation is it right to send 200 as http status code ? I think he should send me 401 ? Correct me if I am wrong.

    That depends on your needs. Write the specification, then implement accordingly. If you say 401, take 401.

    If I am right , is there any way to send http status code from php code so that I can check the http status code on iOS side ?

    Sure, there is. Luckily this has been asked before so the info is already on this website and we do not need to answer it again.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了