如何通过iphone中的控制台检查我的数据是否保存在web服务器api上

如何通过iphone中的控制台检查我的数据是否保存在web服务器api上,iphone,objective-c,api,Iphone,Objective C,Api,我有一个应用程序,通过在textfields中输入值并通过服务器获得响应,将数据发送到我的web服务器API。我编写了以下代码来向服务器发送数据。我想从服务器接收JSON格式的数据 这是我的.h文件: #import <UIKit/UIKit.h> @interface apicontroller : UIViewController { IBOutlet UITextField *txtfirstName; IBOutlet UITextField *txtl

我有一个应用程序,通过在
textfields
中输入值并通过服务器获得响应,将数据发送到我的web服务器API。我编写了以下代码来向服务器发送数据。我想从服务器接收JSON格式的数据

这是我的.h文件:

#import <UIKit/UIKit.h>


@interface apicontroller : UIViewController 
{
    IBOutlet UITextField *txtfirstName;
    IBOutlet UITextField *txtlast;
    IBOutlet UITextField *txtUserName;
    IBOutlet UITextField *txtPassword;
    IBOutlet UITextField *txtEmail;
    NSMutableData *webData;


}
@property (nonatomic,retain)UITextField *txtUserName;
@property(nonatomic,retain)UITextField *txtPassword;
@property (nonatomic,retain)UITextField *txtfirstName;
@property(nonatomic,retain)UITextField *txtlast;
@property(nonatomic,retain)UITextField *txtEmail;
@property(nonatomic,retain)NSMutableData *webData;

-(IBAction)click:(id)sender;


@end
当我运行此代码并在
textfield
中输入值并单击按钮时,我在控制台上得到以下响应:

{“iError”:true,“ErrorMessage”:“需要名字。需要姓氏。需要密码。需要电子邮件。需要用户名。”,“结果”:null,“错误代码”:903}

但我已经将所有参数传递给了api。 请帮我解决这个问题。
谢谢

如果我看一下你的最后一个问题,你的服务器似乎期望URL中的所有数据:

 http://192.168.0.68:91/JourneyMapperAPI?RequestType=Register&Command=NEW&firstname=rocky&lastname=singh&Username=rocky14&Password=xxx&Email=rocky@gmail.com
但是您在URL中发送部分请求,在HTTP正文中发送部分请求作为URL编码的数据

此外,您使用非常通用的名称key1、key2、key3等,而不是特定的名称(firstname、lastname、username、password等)


总的来说,问题很可能是您没有以服务器期望的格式发送请求。如果没有对服务器API的描述,就很难真正找出代码中的问题。

这是web服务器。我猜这不取决于u codeHi@Alex,我没有得到你想说的话,谢谢现在它正在工作。我的数据正在发布到我的api服务器,但我有一个问题,所有这些值都保存到我的服务器数据库,我希望这些值应该通过JSON保存到我的本地数据库。什么样的本地数据库?在你的iPhone上?如果您不想将数据存储在服务器上,为什么首先要将数据发送到服务器上?问题是我不太了解JSON。我想通过JSON读取服务器上的值并将其保存在本地数据库中。这是怎么可能的。感谢iphone上的Sqlite数据库。我想将数据保存在web服务器上,同时将数据保存在服务器上sqlite数据库
 http://192.168.0.68:91/JourneyMapperAPI?RequestType=Register&Command=NEW&firstname=rocky&lastname=singh&Username=rocky14&Password=xxx&Email=rocky@gmail.com