more generic rest library

### Description
Two changes for a more generic rest library:
  o variable serve routine for connectionTreat and
  o accepting 'text/xml' contents on request.

Both characteristics configurable in restInit().