Answers for "express get data od url"

0

how pass data from body in koa js

router.post("/api/comments", async ctx => {
  ctx.session.comments = ctx.session.comments || [];

  if (!ctx.request.body["comment"]) {
   throw Boom.badData("Empty comments not allowed");
  }

  const comment = {
   date: new Date(),
   comment: ctx.request.body["comment"],
  };
  ctx.session.comments.push(comment);
  ctx.status = 201;
  ctx.body = comment;
 });
Posted by: Guest on May-04-2020
-1

send data with url in php

// Send the variables myNumber=1 and myFruit="orange" to the new PHP page...
<a href="page2.php?myNumber=1&myFruit=orange">Next page</a>
Posted by: Guest on January-31-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language