我有这个 php 代码。
<?php
$users = $this->Session->read("user");
$varFName = $users['User']['first_name'];
$varLName = $users['User']['last_name'];
$message = "Hello,
I would like to invite you to Clicksays! ".$varFName." ".$varLName;
echo $this->Form->create('User', array('id' => 'sendEmailRequest', 'style'=>'padding : 0px;', 'url' => array('controller' => 'Contacts', 'action' => 'addEmailRequest')));
echo $this->Form->input('Email', array('id' => 'email', "size"=>"40"));
echo $this->Form->textarea("Message", array("type"=>"textarea", "id"=>"PreviewEmail", "style"=>"display:none;","rows"=>"5", "cols"=>"45", "value"=>$message));
echo $this->Form->button('Preview and edit invitation Clickup', array("id" => "butInvite", "type"=>"button"));
echo $this->Form->button('Send invitation Clickup', array('id' => 'butSendInvitation', 'type'=>'submit'));
echo $this->Form->end(); ?>
现在它接受用户、电子邮件和消息的数据数组:
NSURL *URL = [NSURL URLWithString:@"myLink"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:6.0];
[request setHTTPMethod:@"POST"];
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];
[connection start];
现在我很确定我需要将数组作为 HTTP 正文,但我不知道如何。我不是网络人,对网络编程和方法知之甚少。
我怎样才能传递详细信息?没有它就无法工作,并发布错误以输入用户的详细信息,该代码也存在于 php 中。