user867662
user867662

Reputation: 1171

Restful post API from iOS

We want to call an restful post API from iPhone. Can you give me a sample code snippet for this?

My API URL is http://machinename/asyh/restful.php/1/VideoStreaming Post parameter name is file_chunk.

The API will append the data received in file_chunk parameter to file in the server.

I have called the same API from C#. But I don't know how to invoke it from iOS. Please help me.

The server code is given below (it's in PHP). The restful webservice is is written in PHP using synfony framework.

$fileChunk = $request->getPostParameter('filechunk');
$vodFolder = 'D:\\web\\entertainment\\';
$vodFile = $vodFolder . "testFile.mov";
$fh = fopen($vodFile, 'a');
fwrite($fh, $fileChunk);
fclose($fh);

Upvotes: 1

Views: 2395

Answers (1)

Related Questions