Api helpers
Encode request header and body (if any), send the package to the server and returns its response.