I'm trying to get data using an API that takes GET requests. The data are returned in XML format, so I'm hoping to use the xmlread function, which can take a URL as input. However, because the data comes from an API, I need to build the URL with the GET request's arguments and use that as the input for xmlread.
I don't want to use the urlread and urlwrite functions for these reasons:
1. If I use urlread, I get the data as a string, which can't be passed into xmlread.
2. If I use urlwrite, I have to write the data to a file and read it in from there, using xmlread, which is horribly inefficient when my functions make hundreds of API calls.
Is there a built-in Matlab function that allows me to pass in a URL and a cell array (or some other data type) of (argument_name, value) pairs and build a get URL from that? I'm assuming that if a canned method exists in basic Matlab, it will be more efficient than me writing my own that will be rife with string concatenation.