<commit_before>const coap        = require('../') // or coap

coap.createServer(function(req, res) {
  res.end('Hello ' + req.url.split('/')[1] + '\n. Message payload:\n'+req.payload+'\n')
}).listen(function() {

  var req = coap.request('coap://localhost/Matteo')
  
  var payload = {
    title: 'this is a test payload',
    body: 'containing nothing useful'
  }
  
  req.write(JSON.stringify(payload));
  
  req.on('response', function(res) {
    res.pipe(process.stdout)
    res.on('end', function() {
      process.exit(0)
    })
  })
<commit_msg>Update req_with_payload.js<commit_after>const coap        = require('../') // or coap

coap.createServer(function(req, res) {
  res.end('Hello ' + req.url.split('/')[1] + '\nMessage payload:\n'+req.payload+'\n')
}).listen(function() {

  var req = coap.request('coap://localhost/Matteo')
  
  var payload = {
    title: 'this is a test payload',
    body: 'containing nothing useful'
  }
  
  req.write(JSON.stringify(payload));
  
  req.on('response', function(res) {
    res.pipe(process.stdout)
    res.on('end', function() {
      process.exit(0)
    })
  })

{'fraction_non_alphanumeric': 0.1937219730941704, 'fraction_numerical': 0.003587443946188341, 'mean_word_length': 3.1180811808118083, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1435631', 'n_tokens_mistral': 397, 'n_tokens_neox': 392, 'n_words': 70}