如何使用gluon RESTClient调用POST方法

时间:2016-08-19 19:33:09

标签: java javafx gluon

以下是示例代码。我想用胶子叫一个休息api。

RestClient restClient = RestClient.create()
        .host("https://abc.api.in")
        .path("v1/signup")
        .formParam("name",name)
        .formParam("email",email)
        .formParam("password",password)
        .formParam("repeatPassword",repeatPassword)
        .formParam("refID",refID)
        .method("POST").contentType("text/plain");
GluonObservableObject<SignUpDAO> sample = DataProvider.retrieveObject(restClient.createObjectDataReader(SignUpDAO.class));

但它会发出警告,并且没有显示任何进一步的进展。我正在使用Task从我的控制器调用rest客户端。

INFO: Created Rest Connection:
    Method: POST
    Request URL: urlname
    Form Params: {password=[test123], repeatPassword=[test123], name=[pqr], refID=[dsfdfkdlfk], email=[test@gmail.com]}
    ContentType: text/plain
    Consumer Credentials: null / null
Aug 19, 2016 12:17:20 PM com.gluonhq.connect.converter.JsonConverter readFromJson
INFO: Property password not defined on json object for class class com.gluonapplication.com.coinsecureapp.controller.SignUpDAO.
Aug 19, 2016 12:17:20 PM com.gluonhq.connect.converter.JsonConverter readFromJson
INFO: Property repeatPassword not defined on json object for class class com.gluonapplication.com.coinsecureapp.controller.SignUpDAO.
Aug 19, 2016 12:17:20 PM com.gluonhq.connect.converter.JsonConverter readFromJson
INFO: Property name not defined on json object for class class com.gluonapplication.com.coinsecureapp.controller.SignUpDAO.
Aug 19, 2016 12:17:20 PM com.gluonhq.connect.converter.JsonConverter readFromJson
INFO: Property refID not defined on json object for class class com.gluonapplication.com.coinsecureapp.controller.SignUpDAO.
Aug 19, 2016 12:17:20 PM com.gluonhq.connect.converter.JsonConverter readFromJson
INFO: Property email not defined on json object for class class com.gluonapplication.com.coinsecureapp.controller.SignUpDAO.

0 个答案:

没有答案