Skip to content

Instantly share code, notes, and snippets.

@Marak
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marak/edfc37c8182e567c6cae to your computer and use it in GitHub Desktop.
Save Marak/edfc37c8182e567c6cae to your computer and use it in GitHub Desktop.
hook.io example microservice for accessing incoming http request parameters
// Access incoming HTTP request data
module['exports'] = function accessRequestData (hook) {
var params = hook.params;
// params contains all incoming request parameters,
// such as query string or form data.
// See http://hook.io/docs#data for more information
// Responds back with all incoming HTTP params
hook.res.write(JSON.stringify(hook.params, true, 2));
hook.res.end();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment