-1

how can I send JSON data to apigility using an HTTP POST? I'm trying to send this data:

 {
        "nombre_pais": "MEXICO",
        "id": "20",
        "artist": "JUAN AGUIRRES",
        "title": "CRAZY",
        "genero": "Balada, Pop",
        "ocupacion": "Cantante, Productos",
        "sitio_web": "www.juanAGUIRRE.com",
}

but I get an error:

{
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
  "title": "Bad Request",
  "status": 400,
  "detail": "JSON decoding error: Syntax error, malformed JSON"
}

What should I do? Thank you.

miken32
  • 42,008
  • 16
  • 111
  • 154
BlackHack123
  • 349
  • 1
  • 10

1 Answers1

2

I guess when someone tells you "JSON decoding error: Syntax error, malformed JSON" you should check the syntax of your JSON. http://jsonlint.com/ is one of many online validators. You will find that you have an extra trailing comma after the last value.

Every common language now has the ability to automatically create JSON, don't try doing it yourself.

miken32
  • 42,008
  • 16
  • 111
  • 154