otmezger
otmezger

Reputation: 10784

How to use Matlab webread with 2 http headers

I need to do this GET call with matlab:

curl -X GET \
  -H "X-Parse-Application-Id: my_AppKEY" \
  -H "X-Parse-REST-API-Key: my_APIKEY" \
  https://api.parse.com/1/classes/GameScore

(this is a basic request to parse.com)

In matlab 2014b I have the function webread which becomes a weboptions struct.

I think the correct way of setting a header for the request is like this:

myHeaders1 = weboptions('KeyName', 'X-Parse-Application-Id', 'KeyValue' , 'my_KEY')

The thing is... I can only set 1 header using this syntax. How can I set 2 or more headers to be used in webread?

Upvotes: 2

Views: 1389

Answers (1)

Mo Nazemi
Mo Nazemi

Reputation: 2717

You can either call curl from within Matlab if you load right library files or instead you can use urlread2

Upvotes: 1

Related Questions