- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
1)
我是使用 alamofire 的新手。这是我尝试使用 alamofire 进行 Web 服务检查我错的地方。我在 loginviewcontroller.swift
中进行了登录 Web 服务如下
let url="http://192.169.201.32:9000//users/authenticate"
override func viewDidLoad() {
super.viewDidLoad()
Alamofire.request(url, method: .post, parameters:["username":"andrews","password":"admin2"], encoding: URLEncoding.default)
.responseJSON { response in
print("abcsign in")
print(response)
print("abcsign in3")
print(response.result)
//to get status code
if let status = response.response?.statusCode {
switch(status){
case 201:
print("example success")
default:
print("error with response status: \(status)")
}
}
//to get JSON return value
if let result = response.result.value {
let JSON = result as! NSDictionary
print("abcsign in 2")
print(JSON)
}
}
responseSerializationFailed(Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed(Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 2." UserInfo={NSDebugDescription=Invalid value around character 2.}))
print(response.result)
error with response status: 404
signUpviewcontroller.swift
与
signUp
连接 View Controller 。在
signUpViewController.swift
singUp webservice的代码如下
let url="http://192.169.201.32:9000//patient/signUp"
@IBAction func signUpButtonWasPressed(_ sender: Any) {
Alamofire.request(url, method: .post, parameters:["dob":DateOfBirthTextFeild.text ,
"email":emailIdTextField.text ,
"firstName":FirstNameTextField.text ,
"gender":genderTextField.text ,
"lastName":LastNameTextField.text ,
"middleName":MiddleNameTextField.text ,
"password":passwordTextField.text , //password must be 8 char long
"ssn":ssnTextField.text], encoding: URLEncoding.default)
.responseJSON { response in
print("abcsig up in")
print(response)
print("abcsign up in3")
print(response.result)
//to get status code
if let status = response.response?.statusCode {
switch(status){
case 201:
print("example success")
default:
print("error with response status: \(status)")
}
}
//to get JSON return value
if let result = response.result.value {
let JSON = result as! NSDictionary
print("abcsign up in 2")
print(JSON)
}
}
}
responseSerializationFailed(Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed(Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 2." UserInfo={NSDebugDescription=Invalid value around character 2.}))
print(response.result)
error with response status: 404
最佳答案
关于json - "login"和 "sign up"Web 服务未使用 alamofire 快速提供所需的 json 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49507821/
我提出这个问题是因为我没有找到关于这 3 个 gpg 选项之间差异的明确解释: gpg --sign file # produces file.gpg gpg --clear-sign
以下网页介绍了将 Google 登录集成到网络应用程序中的简单工作流程: https://developers.google.com/identity/sign-in/web/sign-in 实现代码
Microsoft 最近向 Azure AD B2C 添加了新的“注册或登录”策略。 https://azure.microsoft.com/en-us/documentation/articles/
鉴于此 xml: 如何选择包含 version="@2.15"的元素?我无法弄清楚如何将 @-sign 放入 XPath。 提前致谢, 埃里克 最佳答案 此 XPath 选择所
我正在为我的网站进行 Slack 集成,包括允许用户使用“使用 Slack 登录”按钮登录。理想情况下,我希望它只要求用户授予 identity.*权限一次,然后下次当他们单击“使用 Slack 登录
在将我的第二个应用程序项目上传到 PlayStore 时,在为新版本上传 .aab 文件时出现以下错误: "Your Android App Bundle is signed with the wro
As Math.sign() 接受数字参数或数字作为字符串,如 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Gl
我已经在我的网站上实现了 Sign In with Apple。但问题是它只适用于我开发者的 Apple ID。 我尝试在同一环境中使用我的个人 Apple ID,并且登录过程也运行良好。 但是,当真
Signed Short (Signed Int16) 乘法解释? short ss = -32768; // 0x8000 SHRT_MIN ss *= (short) -1; printf ("%
class Book attr_accessor :author attr_reader :title attr_reader :comments def initialize(aut
将我面向公众的应用程序部署到 Azure。旨在将身份验证委托(delegate)给 Microsoft、Google、Facebook、Apple 等。因此,一旦用户通过其声称的身份验证并且该提供商返
好吧,我对使用 API 的理解有限 我试图掌握 Adobe Sign API 并遇到了死胡同,在测试页面上我输入了这个并且它有效 但我不知道如何在 C# 中做到这一点 我尝试了以下方法,但知道它缺
上下文 我使用 booth Cognito 用户池和 Cognito 身份池来登录用户。 我想完成一个简单的任务,让用户在 iOS 应用程序(Swift 应用程序)上登录。 我的应用程序基于自定义版本
这可能是一个非常简单的答案,但我无法在任何地方找到它。可能是我以某种方式错过了一个非常基本的 CSS 规则。 这是我的 Sass 代码: h3 { font-size: 20px; m
我见过很多将 hex 转换为 int 的问题,但这些都是 unsigned-> unsigned 的变体。如何将带符号的十六进制转换为 Int? 例如。 somefunc('0xfffff830')
我对 C# 中的准备语句有疑问: OdbcCommand cmd = sql.CreateCommand(); cmd.CommandText = "SELECT UNIQUE_ID FROM use
我想知道是否有办法在我发送授权请求之前如果用户是第一次在 Apple 注册我的应用程序,或者他/她是否已经注册,只需登录即可。 基本上我的应用程序中有一个注册屏幕,用户可以在其中创建两种类型的用户和一
我是 Rails 的新手,我正在使用“设计”gem 进行身份验证。 首先,我通过默认注册页面(例如/users/sign_up)添加一个新用户 然后,我按照从 Devise before filter
当我使用 web3.eth.sign() 方法和 web3.eth.accounts.sign() 方法对字符串进行签名时。两个签名的结果值不同。我不知道为什么这两个结果不同。 我正在使用最新的 we
我正在使用受信任的 CA 颁发的证书签署 EXE 程序。 我正在使用 Windows SDK v6.0a 中的 signtool.exe。 该证书位于计算机商店中,位于“个人”文件夹中。 我的命令行是
我是一名优秀的程序员,十分优秀!