I want to use face.com face detection API (send an image to a server and get back an xml string result).
I use urlread() and it cannot upload an image file.
the code:
fid = fopen('T000.jpg');
im = fread(fid,Inf,'*uint8');
fclose(fid);
urlread('http://api.face.com/faces/detect.xml','post',...
{'api_key' , MY_CODE,...
'api_secret' , MY_SECRET,...
'detector' , 'Normal',...
'attributes' , 'all',...
'file' , im})
But it returns an error because MATLAB tries to encode the image as url.
Note: when I use an image on the web it does work (since no file is uploaded).
urlread('http://api.face.com/faces/detect.xml','post',...
{'api_key' , MY_CODE,...
'api_secret' , MY_SECRET,...
'detector' , 'Normal',...
'attributes' , 'all',...
'urls' , 'http://0.tqn.com/d/beauty/1/0/x/3/1/halle_berry_pixie.jpg'})
I found an answer. An alternative implementation to urlread() on the File Exchange.