How to code for HTTP POST request with request data (payload)?

edited February 2016 in Kinoma Coding

Can you please tell me what will be the code for POST request. I want to send some JSON data in the request.

For example:

   url : 
   data to be sent : {lmn: 'rock'}
   method: POST

What will be the code for this example?

Thank you


  • Answer ✓

    Hi there! Sorry this response is so late--this post got buried somehow. In case anyone needs the answer to this:

    For Kinoma Create, the code would be:

    let request = new Message("");
    request.method = "POST";
    request.requestText = JSON.stringify( {lmn: 'rock'} ); 

    For Kinoma Element, the code would be:

    import HTTPClientRequest from "HTTPClient";
    let request = new HTTPClientRequest("");
    request.method = "POST";
    request.start(JSON.stringify( {lmn: 'rock'} ));
  • Thanks for your response! It was a long time back but I was able to figure out the solution.

Sign In or Register to comment.