【问题标题】:android Send multi parameter in post method to WCF service by using retrofit lib?android 通过使用改造库将post方法中的多参数发送到WCF服务?
【发布时间】:2016-06-15 17:53:44
【问题描述】:

我应该用post方法发送4个参数

[WebInvoke(Method = "POST",
       ResponseFormat = WebMessageFormat.Json,
       BodyStyle = WebMessageBodyStyle.Wrapped,
       UriTemplate = "CustomerInsertPost/{Username}/{Password}/{lan}/{Cust}")]
    int CustomerInsertPost(string Username, string Password, string lan, string Cust);

通过使用改造库。

这个“CustomerInsertPost”的格式后改进方法是什么?

【问题讨论】:

    标签: java android wcf retrofit


    【解决方案1】:

    http://square.github.io/retrofit/ 上的第一个例子是

    public interface GitHubService {
      @GET("users/{user}/repos")
      Call<List<Repo>> listRepos(@Path("user") String user);
    }
    

    如果这也适用于 POST 请求,那么您就快到了。

    【讨论】:

    • 插入错误:com.squareup.okhttp.ResponseBody 错误请求'@GET("CustomerInsertPost/{Username}/{Password}/{lan}/{Cust}") 调用 customerInsert( @Path("Username") String userName, @Path("Password") String Pass , @Path("lan") String lan, @Path("Cust") String customer);'
    猜你喜欢
    • 1970-01-01
    • 2014-06-10
    • 1970-01-01
    • 1970-01-01
    • 2023-04-06
    • 1970-01-01
    • 2020-01-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多