-1

I need to send this JSON with HTTP post request, but I Want to convert him to a String, I have problem with the " " if somebody can do it for me or explain it for me it will help me, thank you!

{
  "inputs": [
    {
      "data": {
        "image": {
          "url": "https://someImage.jpg"
        }
      }
    }
  ]
}
Bar Kozlovski
  • 39
  • 1
  • 8

2 Answers2

0

You can try

let str :[String:Any] =  [
    "inputs": [
    [
    "data": [
    "image": [
    "url": "https://someImage.jpg"
    ]
    ]
    ]
]]
Sh_Khan
  • 93,445
  • 7
  • 57
  • 76
0

To make it dynamic use following approach:

let url = [
    "url": "https://someImage.jpg"
]

let data = [
    "image":url
]

let inputs = [
    "data": [data]
]
Bhavik Modi
  • 1,461
  • 13
  • 27