Nikola Milovic
08/12/2021, 11:40 AMval data = JSONObject()
data.put("email", "email")
data.put("name", "testname")
data.put("companyName", "testcompname")
return singleFromCoroutine {
try {
val response: HttpResponse =
<http://client.post|client.post>("${serverUrl}${apiEndpoint}/account") {
body = data.toString()
contentType(ContentType.Application.Json)
}
Not sure what is happening, I'll post the entire request that gets received by the server[Node] SyntaxError: Unexpected token " in JSON at position 0
[Node] at JSON.parse (<anonymous>)
Aleksei Tirman [JB]
08/12/2021, 11:55 AMNikola Milovic
08/12/2021, 12:16 PMdata.toString
and leave it as a JSONObject?Aleksei Tirman [JB]
08/12/2021, 12:22 PM