as的api是干净的,我想将它用于一个新的项目,但是它通常会在StringEntity中发布一个Json作为参数,如下所示
JSONObject TokenRequest = new JSONObject()
.put("Credentials", new JSONObject()
.put("Username", username)
.put("Password", password));
StringEntity requestBody = new StringEntity(TokenRequest.toString());
httppost.setEntity(requestBody);不确定它能不能用scalaj-http?
发布于 2017-09-29 13:54:08
根据他们的github页面,您需要将content-type头设置为application/json,以便将主体发送为json。
Http(url).postData(data).header("content-type", "application/json").asString.codehttps://stackoverflow.com/questions/46490129
复制相似问题