如何在API上发布?

I am beginner with Android, I am in trouble. How do I parse and POST any thing using an API.

I have two APIs:

  1. http://www.myrwa.in/instaapi/getEventTypeList
  2. http://www.instapartyz.com/instaapi/index.php?method=getEventTypeList

Second API is working properly and gives a response but when I use the first API it does not produce a response but both APIs are same on Postman. I do not know what is wrong with my code.

I want to replace second API with first API .

Here is my code:

private void getEventTypeList(){
    final ProgressDialog pDialog = new ProgressDialog(this);
    pDialog.setMessage("Loading...");
    pDialog.show();
   // JSONObject jsonObject = null;
    JSONObject jsonObject = new JSONObject();
    CustomJSONObjectRequest jsonObjectRequest = new CustomJSONObjectRequest(Request.Method.POST, Constants.EVENT_TYPE_LIST_URL, jsonObject, new Response.Listener<JSONObject>() {
        @Override
        public void onResponse(JSONObject response) {
            Utility.showLogError(PostRequirParty.this, "GetEventTypeListResponse" + response.toString());
            DataBean bean = new DataBean();
            bean = parser.getEventTypeList(response);
            eventBeansList = new ArrayList<EventTypeBean>();
            eventBeansList = bean.getEventTypeList();
            eventNamesArr = new String[eventBeansList.size()];
            for (int i = 0; i < eventBeansList.size(); i++) {
                eventNamesArr[i] = eventBeansList.get(i).getEvent_type_name();
            }
            // hiding progressDialog
            pDialog.hide();
            ArrayAdapter<String> eventTypeAdapter = new ArrayAdapter<String>(PostRequirParty.this, R.layout.spinner_item, eventNamesArr);
            eventTypeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            event.setAdapter(new NothingSelectedSpinnerAdapter(eventTypeAdapter, R.layout.spinner_row_nothing_selected, PostRequirParty.this));
            //event.setPrompt("Select");
            event.setAdapter(eventTypeAdapter);
            final DataBean finalBean = bean;
            event.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
                @Override
                public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                    event_id = finalBean.getEventTypeList().get(position).getEvent_type_id();
                }

                @Override
                public void onNothingSelected(AdapterView<?> parent) {

                }
            });


        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            pDialog.hide();
            Utility.showToastMsg(PostRequirParty.this, error.getMessage());
        }
    });
    Utility.showLogError(PostRequirParty.this, "GetEventTypeList URL = " + Constants.EVENT_TYPE_LIST_URL);
    AppController.getInstance().addToRequestQueue(jsonObjectRequest);
}

Here is my parsing code:

public DataBean getEventTypeList(JSONObject response) {

    DataBean dataBean = new DataBean();
    ArrayList<EventTypeBean> eventTypeList = new ArrayList<EventTypeBean>();
        if (response != null){
            try{

                JSONArray jsonArray = response.getJSONArray(Constants.DATA);
                for (int i = 0; i < jsonArray.length(); i++) {
                    EventTypeBean typeBean = new EventTypeBean();
                    typeBean.setEvent_type_id(jsonArray.getJSONObject(i).getString(Constants.EVENT_TYPE_ID));
                    typeBean.setEvent_type_name(jsonArray.getJSONObject(i).getString(Constants.EVENT_TYPE_NAME));
                    eventTypeList.add(typeBean);
                }
            }catch (JSONException e){
                e.printStackTrace();
            }

            dataBean.setEventTypeList(eventTypeList);

        }

    return dataBean;
}