Rest Builder Client post request with header issue

2019-03-04 14:26发布

I am trying post request with rest client builder.

We have following code

RestBuilder rest = new RestBuilder()
rest = rest.post("https://api..com/ff/one"){
    header 'x-pushbots-appid', '550de488b4569'
    header 'x-pushbots-secret', 'e6717aea77d'
    contentType "application/json"
    json {
        token ="APA91bG9rUbBPURYejC1uzDLbqUMaeHulCtBNIYUokqV5QUwelLygKi8c5c2kD2lq05DXiiKJEDgH8NGfM6DFGhCETgSuX5kOr"
        platform="1"
        msg ="sarath test from API call"
        sound ="ding"
        badge ="badge"
        payload ="JSON"
    }
}

Postman is giving correct result for this request , while using rest client builder plugin, response is coming as null. I checked in api doc and code looks fine.

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-03-04 14:46

it seems i was wrong version of json builder. Issue got fixed after using compile ":rest-client-builder:2.1.1"

查看更多
登录 后发表回答