function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Getting my feet wet with web services

So, I'm just getting my feet wet with web services and there is one thing that I can't seem to figure out. I get how to accept data to my web service as XML but what if I just wanted a string of variables posted? I.e. my web service currently looks like this:

global class TestWebServ {
webService static string getInfo(String info) {
Account a = new Account(name = 'Test Information', description = info);
insert a;
return 'Completed!';

I would like to send data to this service by simply posting to:


Is this possible? Any help would be greatly appreciated.
Check out the Apex HTTP classes:

Thank you for the info. I think that I'm looking for the exact opposite functionality. I would like to make a call (from an external app to Salesforce) in that HTTP format. So an outside app would call:

with a request. And SF would take those variables and do something with them.
Sorry, you are correct.

Enabling an Apex Web Service, as your sample does, will enable a SOAP-based web service. Not a RESTful web service.

Thanks for getting back to me so quick. Are there any methods of doing RESTful web services in SF? If not, have you seen any workarounds for this? I was thinking of maybe using an email service instead.