title: How to give parameter in rest client when calling moodle webservice function?
body: <p><strong>rest client.php</strong></p>
  
  <pre><code>&lt;?php
  
  $token = '4f920ddef0bd90d84ef316621fde6d22';
  
  $domainname = 'localhost';
  
  $functionname = 'local_wstemplate_hello_world';
  
  $we='hello';
  
  $restformat = 'json'; 
  
  $params = array($we);
  
  /// REST CALL
  header('Content-Type: text/plain');
  
  $serverurl = $domainname . '/moodle/server/moodle/webservice/rest/server.php'. '?wstoken=' . $token . '&amp;wsfunction='.$functionname;
  
  require_once('./curl.php');
  
  $curl = new curl;
  
  $restformat = ($restformat == 'json')?'&amp;moodlewsrestformat=' . $restformat:'';
  
  $resp = $curl-&gt;post($serverurl . $restformat ,$params);
  
  print_r($resp);
  </code></pre>
  
  <p>I have a function which takes string as argument and then displays it.but i cant figure out how to give the parameter.it always throw this error</p>
  
  <pre><code>{"exception":"invalid_parameter_exception","errorcode":"invalidparameter","message":"Invalid parameter value detected","debuginfo":"Missing required key in single structure: welcomemessage"}
  </code></pre>
  
  <p>I am new to moodle.So anyone can tell me how to pass parameter to the function?</p>