Help Sending a curl request (UPDATE KODI)

Correct - but keep in mind, that you sometimes have to escape some special characters.

rlkoshak told me about that at the start of the post so thats what i need to learn too be able too use the exec binding on my own

1 Like

I had popped into this thread a few days ago, but didn’t realize you had been struggling with this… better late than never! To do this with executeCommandLine, you need to triple escape some of the quotes…

executeCommandLine("/bin/sh@@-c@@/usr/bin/curl -su user:password -s -X POST -H \"Content-Type: application/json\" -d \"{\\\"jsonrpc\\\":\\\"2.0\\\",\\\"method\\\":\\\"VideoLibrary.Scan\\\",\\\"id\\\":1}\" \"http://[your kodi IP]:8080/jsonrpc?request=\"",5000)

Hi Everyone this is no longer working after Exec Binding Updated to include whitelist

any tips?

  1. executeCommandLine() is not affected by the whitelist, because the whitelist is only for the exec binding
  2. you shouldn’t have tagged this into a 2-year-dead thread

Hi again @namraccr

This post also contains the version of exec I am dealing with it was a post talking about different ways too do what I wanted its not just about the exec command and I was receiving the whitelist error so it must affect exec command?

I wrote this post its where I originally found out how too get openhab too updated the kodi library the people on this post helped me with the topic in the first place so I think it’s appropriate enought too add it here for anyone else who might encounter the same problem and also help too troubleshoot the issue, it also helps me keep track of related posts for future reference