I want to do this in WordPress, but I’m struggling to figure out the best way to do it. I want to get the data back and use it to create HTML content inside wordpress…
Guidance on exactly how to call a web service from WordPress and work with the response would be a big help!
The following is how I do it in C# using a WebClient() class.
using (var wb = new WebClient())
{
var data = new NameValueCollection();
data[“api_id”] = “xxxxx”;
data[“api_key”] = “xxxxx”;
data[“location_nid”] = “x”;
data[“api_url”] = “xxxxxxx”;
data[“version”] = “x”;
data[“format”] = “XML”;
data[“dispensaryId”] = “xxxxxx”;
Uri mjUri = new Uri(“webserviceurl”);
wb.UploadValues(mjUri, “POST”, data);
var data = Encoding.ASCII.GetString(response);
}
Kind regards,
BH