Google Reader API request token, get 400:Bad Request - android

this Android code worked fine before, but i'm having problems for some reason. here is the request i'm trying to make:
https://www.google.com/reader/api/0/token
i'm getting 400:Bad Request as a response, and i'm not sure why. isn't this the correct URL for requesting a token? the auth token is being passed as a header in all requests now, and i can request feed list, and it works just fine, so there's nothing wrong with the auth code. what gives?
in addition, i can request a token in a normal browser, like Chrome, and get a token as a response body. so the request itself is not the problem. i just can't figure out what is wrong with my requests in code...

the answer is to use http rather than https. if anyone else is having trouble getting tokens from the unofficial google reader api, check whether you are using secure http or not.

Related

API works in browser but not in postman or app

All the API's work in the browser but none of them is working in my android app and postman.
Status:
In postman and in my app, error code received is:
500 Internal Server Error
I think your problem is csrf-token you can disabled it in
App\Http\Middleware\VerifyCsrfToken
and add your routes name in this array
$except = [] array.
It could be that postman is missing some request headers, cookies or session data. You could look into using Postman Interceptor. It's a tool which records requests made from Google Chrome and clones them to your Postman history. From that history tab you can simply replay the request, which will be an exact clone. Maybe that'll resolve the 500 errors you're getting.

HTTP basic request in Android

I want to do a POST HTTP request to the serving to receive some cookies from the server. During this POST request I also need to send some data like login and password. I found a lot of solutions but nothing is working, everything that I found is deprecated.
So the question is: how can I make a HTTP POST request to receive form the server some cookies after?

LoopJ AndroidAsyncHttp redirect not working

I have an android application where I have authentication and authorization services. Recently we had to change our URL's from http to https. I really don't want to resubmit app to the app store with urls changed to https.
Main problem I am facing is, asynchttpclient returning status code 200 without response, why I am not getting 301 which I am getting when I try to call service through advanced rest client.
I tried this already:
aesHttpClient.getHttpClient().getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, false);
I want to know how can I redirect in asynchttpclient?
Please help
AsyncHttpClient client = new AsyncHttpClient();
client.setEnableRedirects(true);

Authentication for GET Request in Android HTTP/1.1 406 Not Acceptable

I tried but there seems to be a problem in making a GET Request to a heroku URL example "https://xxxx-xxxxx.herokuapp.com/xxxxxx/xxxxxxxx"
I know the general method is
HttpClient client = factory.getHttpClient(); //or any method to get a client instance
Credentials credentials = new UsernamePasswordCredentials(username, password);
client.getState().setCredentials(AuthScope.ANY, credentials);
And I know that getState() is not available for 3.x version.
I don't know how the Chrome's "Advance REST Client" has handled it, it gave me the pop up and asked for the username and password and I entered Credentials and it worked and since then its working fine. I thought It might have stored the credential locally but, its not the case. I checked all the cookies and cache. I deleted the extension and cleared data and its still working.
Then I tried to use another REST Client by WizTools (for Mac). In the Authorization section there are 3 options. 1.) Basic, 2.) Digest and 3.)Preemptive, I did some permutation and combination with it using the given Credentials but all the time it gave the same response i.e.
"HTTP/1.1 406 Not Acceptable"
I don't understand what's the issues is?
Thanks,
I don't know, if why is it not working, but I used URLConnecton used the authentication mentioned and it worked. I got the response. And yeah BTW I had to assign the "Accept" type a s "Application/Json"

How to use the access token to sign the POST request?

I have an access token and i want to send the POST request and with the some feed in the body. The problem is i am able to get the GET request using the URLConnection but when i use the HttpPost I am not able to send the POST request.
I guess this problem has to do something with not being able to sign the POST request using HttpPost.
Can any one share the sample code for sending the POST request by signing it with the access token?
TIA
I am not really sure, but it sounds like you want to use some kind of OAuth (access tokens, etc.)?! Then http://code.google.com/p/oauth-signpost/ might be a little help for you.

Categories

Resources