Superfluous "Stringification" and

The following exception:

" JsonParser#getObject() or JsonParser#getObjectStream() is valid only for START_OBJECT parser state. But current parser state is VALUE_STRING"

...can be caused by a superfluous "stringification" of regular JavaScript strings, like e.g. JSON.stringify(aString)

The JSON-P parser expects: {"hey":"duke"} but gets: "{\"hey\":\"duke\"}"

To fix the problem, remove JSON.stringify(aString); and send the string directly to the MicroProfile server:

const payload = "{"hey":"duke"}";
const response = await fetch("http://localhost:8080/imports", {
    method: 'POST',
    body: payload,
    headers: {


Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
...the last 150 posts
...the last 10 comments