Code Monkey home page Code Monkey logo

volley-demo's Issues

How i can check my post request?

Hello i'm using volley on my project, put i'm having an issue with the POST request. I'm looking a way to see the POST request (the response and post url) in order to check where is my problem. if it is on the parameters or on the rest api that i have done. using curl -i and curl--data the rest api is working fine. thank you

here is my code
JsonObjectRequest jsonObjReq = new JsonObjectRequest(Method.POST,
url, null,
new Response.Listener() {

                  @Override
                  public void onResponse(JSONObject response) {
                    Log.i(TAG," The Response (Update): " + response.toString());
                    if (response != null) {
                       parseJSON(response,"update_existing");
                    }

                    /*
                     * Download the pizzules from the REST API
                     */
                    puzzle_paths = new ArrayList<String>();
                    inizializePuzzles();
                    if (!puzzlesList.isEmpty())
                    {
                        for (int i =0; i<puzzlesList.size();i++)
                        {
                            puzzle_paths.add(puzzlesList.get(i).getPuzzlePath());
                            puzzle_paths.add(puzzlesList.get(i).getSolutionPath());
                        }


                        activity.runOnUiThread(new Runnable() {
                              public void run() {
                                  new DownloadFile(activity,puzzle_paths);
                              }});

                        storePuzzles();
                    }
              }
                    }, new Response.ErrorListener() {

                        @Override
                        public void onErrorResponse(VolleyError error) {
                            Log.d(TAG, "The Error: " + error.toString());

                        }
                    }) {

                @Override
                protected Map<String, String> getParams() {
                    Map<String, String> params = new HashMap<String, String>();
                        params.put("date", date);   
                    return params;
                }

            };
            VolleyClass.getInstance().addToRequestQueue(jsonObjReq);

where date = 16-08-2014+14%3A31%3A37

also is there any available forum about volley?

MultiPartRequest bug

MultiPartRequest can't upload file, I think the bug is in SslHttpStack,
setMultiPartBody(postRequest,request); //setEntity
setEntityIfNonEmptyBody(postRequest, request); //setEntity

you have set httpRequest.setEntity(entity) twice, so the MuliPartBody entity is override by getBody entity.

ClientError - Can't import

Hey there!

I've been trying to adapt your code to my own project, but I'm stucked with this problem.
(JSONObjectResponseActivity.java)

`jsonObjRequest = new JsonObjectRequest(Request.Method.GET, builder.toString(), null, new Response.Listener() {
@OverRide
public void onResponse(JSONObject response) {
try {
parseFlickrImageResponse(response);
mAdapter.notifyDataSetChanged();
} catch (Exception e) {
e.printStackTrace();
showToast("JSON parse error");
}
stopProgress();
}
}, new Response.ErrorListener() {

		@Override
		public void onErrorResponse(VolleyError error) {
			// Handle your error types accordingly.For Timeout & No connection error, you can show 'retry' button.
			// For AuthFailure, you can re login with user credentials.
			// For ClientError, 400 & 401, Errors happening on client side when sending api request.
			// In this case you can check how client is forming the api and debug accordingly.
			// For ServerError 5xx, you can do retry or handle accordingly.
			if( error instanceof NetworkError) {
			} else if( error instanceof ClientError) {
			} else if( error instanceof ServerError) {
			} else if( error instanceof AuthFailureError) {
			} else if( error instanceof ParseError) {
			} else if( error instanceof NoConnectionError) {
			} else if( error instanceof TimeoutError) {
			}

			stopProgress();
			showToast(error.getMessage());
		}
	});`

In this part of the code, ClientError cannot be resolved.

I've tried to import volley in several ways (.jar, compile 'com.android.volley:volley:1.0.0', compile 'com.mcxiaoke.volley:library:1.0.19', etc) but none of them can resolve import com.android.volley.ClientError;

I'd really appreciate any help you could give me.

Thanks in advance.

Multipart TimeoutError problem

I am using multipart implementation of yours but I am getting TimeoutError a lot.

Actually, I don't know the difference but, there are TimeoutError and TimeoutException. I am setting timeout to 5 minutes using retry policy, if it exceeds 5 minutes it gives TimeoutException which is not bad. But sometimes, it give TimeoutError after like 10 seconds randomly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.