简体   繁体   English

如何在 Z03D476861AFD3841110F2CB80CCFA8 中请求 Rest API eclipse 服务?

[英]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. I generate this Rest API service in java eclipse, now i am not sure how to test this in Postman.

So can anyone guide me on how the @QueryParam json object will be written 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");

Either it's inside url, body or form data I don't have idea about it,要么在 url 内部,要么在正文或表单数据中,我对此一无所知,

You can give encoded Query Param in the Postman Inside Params tab near Auth Tab as shown below.您可以在 Auth 选项卡附近的 Postman Inside Params 选项卡中提供编码的查询参数,如下所示。

You can do encoding of data from https://www.url-encode-decode.com/您可以对来自https://www.url-encode-decode.com/的数据进行编码

在此处输入图像描述 在此处输入图像描述

Edit:编辑:

As you can see I got a perfect response from API.如您所见,我得到了 API 的完美回应。 I returned the Value of JSON from API.我从 API 返回了 JSON 的值。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM