php - 我想使用 HpCloud for iphone sdk 的人脸检测 API

标签 php ios iphone face-detection

我们可以通过两种方式使用人脸检测: 1. 通过 url 2. 通过上传图片。

我需要使用第二个。

我得到了类似 php 的代码

<form action="path_to_facedetect" method="POST" enctype="multipart/form-data">
    <input type="file" id="pic" name="pic" />
    <input type="text" id="url_object_store" name="url_object_store" />
    <input type="submit" value="Send it..." />
</form>

来自链接: http://map.hpl.hp.com/face-detection/api.html

谁能告诉我如何在 iPhone 中传递数据?

我需要通过:

1.url_object_store 2.X-Auth-Token 3.bytes图片数组

最佳答案

创建发布请求并传递数据,如 thisthis来自 iphone 的链接。

另一种方法我会建议用 base64 字符串对您的图像进行编码,然后将其与来自 iphone 的 post 请求一起发送。从 php webservice 解码相同的字符串以创建图像并将其存储到服务器。

关于php - 我想使用 HpCloud for iphone sdk 的人脸检测 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19653310/

相关文章:

ios - touchesEnded 在设备改变方向后没有被调用

ios - WooCommerce iOS OAuth 无效签名

objective-c - 从发行版本中删除NSLog

ios - 减小 AppStore 的 iOS 应用程序大小 (Xamarin)

iphone - 在 UIWebview 中重新加载 gif 图像

php - 什么时候不会在 PHP 中调用 __destruct?

php - 发送私有(private)消息或向 socket.io 中的特定用户发送消息的问题

iPhone SDK : [MobileOfferViewController _shouldUseKeyWindowStack]

php - 通过从mysql数据库获取图像来显示php文件中的一些图像

php - Twig - 迭代表单字段