title: passing optional query string parameters to http service call
body: <p>i need to make an API call which allows me to pass through optional query sting params</p>
  
  <pre><code> retrieveConts(param1:string,param2?:string):Observable&lt;IContracts&gt; {  
    this.basePath =  "/myConts"; 
        return http.get(this.basePath,{ 
        params: {  
         arg1:param1,
         arg2:param2,
        },
        withCredentials: false
      }) 
       .catch(this._errorHandler); 
    }
  </code></pre>
  
  <p>With the above code spinet, i have declared param2 as an optional parameter which can or cannot be passed through to the service call, however if param2 gets no value, it then returns <code>undefined</code> for which its understandable. </p>
  
  <p>How do i make the service call to ignore the "arg2" parameter if no value was returned from the param2 variable?</p>