我有这条路径www.exemple.com
但我的网站位于www.exemple.com/website/
当有人访问www.exemple.com
时,他们可能会被重定向到www.exemple.com/website/
吗?
答案 0 :(得分:1)
在您的网站根目录.htaccess有此规则:
JsonObjectRequest request = new JsonObjectRequest(Request.Method.POST,
URL_REGISTER, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
System.out.println(response.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
System.out.println("Error");
}
}) {
@Override
public String getBodyContentType() {
return "application/json";
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/json");
return headers;
}
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
JSONObject tmpObject = new JSONObject();
try {
tmpObject.put("name", "simon");
} catch (JSONException e) {
e.printStackTrace();
}
params.put("name", tmpObject.toString());
params.put("email", "test@test");
params.put("password", "1234");
return params;
}
};
RequestQueue requestQueue = Volley.newRequestQueue(registration);
requestQueue.add(request);
requestQueue.start();