如何在邮递员中请求 Rest API eclipse 服务?
How to request Rest API eclipse service in postman?
我在 java eclipse 中生成了这个 Rest API 服务,现在我不确定如何在 Postman 中测试它。
谁能指导我如何用 postman 编写 @QueryParam
json 对象?
@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 的值
我在 java eclipse 中生成了这个 Rest API 服务,现在我不确定如何在 Postman 中测试它。
谁能指导我如何用 postman 编写 @QueryParam
json 对象?
@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 的值