![](/img/trans.png)
[英]Spring-boot rest api current request is not multipart request with postman
[英]How to request Rest API eclipse service in postman?
I generate this Rest API service in java eclipse, now i am not sure how to test this in Postman.
那么任何人都可以指导我如何将@QueryParam
json object 写成 postman 吗?
@Path("/UpdateTenantProfile")
public class UpdateTenantProfile {
@SuppressWarnings({ "unchecked" })
@POST
@Path("UpdateTenantProfiledetails")
@Produces("application/json")
@Consumes("application/json")
public String UpdateTenantProfilem(@QueryParam("profileDetail") JSONObject profileDetail) throws JSONException {
Connection dbConnection = null;
Statement stmt = null;
JSONObject jsarr = new JSONObject();
try {
// con.setAutoCommit(false);
dbConnection = DBConnection.getDBConnection();
dbConnection.setAutoCommit(false);
stmt = (Statement) dbConnection.createStatement();
// System.out.println("Iam entering try catch bloxck");
// System.out.println("length of json data"+kcm.length());
String PIDNO = profileDetail.getString("PIDNO");
String GENDER = profileDetail.getString("GENDER");
String TENANTNAME = profileDetail.getString("TENANTNAME");
String EMAIL = profileDetail.getString("EMAIL");
String OFFPHONE = profileDetail.getString("OFFPHONE");
String MOBILE = profileDetail.getString("MOBILE");
要么在 url 内部,要么在正文或表单数据中,我对此一无所知,
您可以在 Auth 选项卡附近的 Postman Inside Params 选项卡中提供编码的查询参数,如下所示。
您可以对来自https://www.url-encode-decode.com/的数据进行编码
编辑:
如您所见,我得到了 API 的完美回应。 我从 API 返回了 JSON 的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.