Search code examples
pythonjsonaws-glueapi-gateway

REST API request body with python dictionary


I am working with AWS REST API. I am trying to invoke glue job via REST API. For that, I need to pass arguments as JSON object. And withing this json object, I should pass python dictionary as JSON value. This is the request body,

   {
    "Arguments":{
    "jobParameter":"{
  'key1':'keyname=subvalue',
  'key2':'value2'
}"

},
    "JobName":"jobname"
    }

python dictionary = { 'key1':'keyname=subvalue', 'key2':'value2' }

When I test the API by giving this as input, it gives an error,

{ "__type": "SerializationException" }

Please can anyone help with this?


Solution

  • I think it's not recognizing as a valid JSON. Try send something diferente as parameter of jobParameter to test.