REST POST Json

0
Hi,   I am having problems withe sending Json data to npm json-server.  On the server I have structure like this below. [ { "id": 0, "type": "Call Report", "date": "16-06-2018", "category": "Opportunity", "priority": "high", "creator": "John Doe", "text": "Lorem ipsum Opp", "link": "" }, { "id": 1, "type": "Visit Report", "date": "12-10-2018", "category": "Installed Base", "priority": "medium", "creator": "John Travolta", "text": "Lorem ipsum IB", "link": "" } ] What i need to send to it is this: "id": 0, "type": "Call Report", "date": "16-06-2018", "category": "Opportunity", "priority": "high", "creator": "John Doe", "text": "Lorem ipsum Opp", "link": "" I have already tried it with Ionic and it works ok. Now i am trying to POST it with microflow. I've selected Custom request template and now I don't know how or what to put in field to send some fixed data just to see if it works. if I send something like this on image, it creates a new object on server but it contains only next increment of id not my data.  I also don't know how to check what it actually sends in request payload. I see it triggers post in console on the server but in browser I don't see it. Main thing is what do I need to put in the field above to send Json data through ? I've tried with export mapping and suitable object but it doesn't work.   Miha
asked
3 answers
0

Have you tried turning up the log levels to Trace on your Mendix application? That should output the web service call to your console so you can see what is being sent.

answered
0

Hi, yes I've tried. For example trace says it is sending {"id":92} I've tried copy paste this into online POST service to  try t. Online test generates correct 92 id as you see bellow, Mendix POST generates bottom two values, and I've copy pasted it from mendix.

  {
    "id": 92
  },
  {
    "id": "ycHl~O~"
  },
  {
    "id": "Vur8_Ge"
  }
answered
0

Ok, for some reason, same thing described above started producing nice id values. I don't know why but for now it works. Thanks for answer, trace tip helped to copy paste solution faster.

answered