2

I have been able to get the following Matlab plugin to work with my JSON return string: http://www.mathworks.com/matlabcentral/fileexchange/23393 (I am just copy and pasting the JSON into a file from my web browser)

However the RESTful webservice that I am hitting requires a login. I have been able to do this in java using org.apache.commons.httpclient.HttpClient; but can't seem to find a clean way of doing this in Matlab ...

slayton
  • 20,123
  • 10
  • 60
  • 89
onzyone
  • 78
  • 6

1 Answers1

1

Matlab allows the integration of and use of Java Classes and Methods. So if you already have the code working in Java, I'd just use that code in matlab.

Edit: If you're dead set on using matlab then you should probably check out urlread2. Although I have no clue if you can use it to save and use session cookies.

slayton
  • 20,123
  • 10
  • 60
  • 89
  • this is true and for the timing of my project I may have to go this way. Just putting the question out there to see if I can do all in matlab – onzyone Sep 07 '12 at 20:13
  • @onzyone I think the biggest problem you're going to run into is how you handle the cookies. I haven't found anything about how to store and use cookies in matlab. – slayton Sep 07 '12 at 20:39
  • @onzyone you might use something `wget` to handle the cookies for you... http://stackoverflow.com/a/8649280/694184 – slayton Sep 07 '12 at 20:40