Is Http post method available for SmartThings IDE?

Hi Guys,

Just started This SmartThings development and groovy language today.
Is there any way to perform http post method?
I tried this on my app and i receive following error

  • error java.lang.NullPointerException: Cannot invoke method request() on null object @ line 60

    http.request(POST) {
    uri.path = '
    body = [name: ‘bob’, title: ‘construction worker’]
    requestContentType = ContentType.JSON

    response.success = { resp ->
    println “Success! ${resp.status}”

    response.failure = { resp ->
    println “Request failed with status ${resp.status}”

There is a method called httpPost that will do what you want

1 Like

Thanks a lot, that’s what i need :slight_smile: