I'm currently attempting to create an Android application for Danbooru with some success. I've run into a weird problem involving 403 forbidden. When I access /post/index.json using Firefox, I was successful in getting the JSON array. I was also successful when I accessed /post/index.json?limit=12&page=3.
On the Android emulator for Eclipse, accessing /post/index.json gives me the 403 forbidden error. I was able to access /tag/index.json. I've read that Danbooru rejects all requests with a certain header and I'm wondering if I have to modify my header request and what header to modify if I do.
I pasted my code below. The url is currently pointing to http://danbooru.donmai.us/post/index.json.
HttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(new HttpPost(url));
HttpEntity entity = response.getEntity();
Log.w("w",response.getStatusLine().getReasonPhrase() +"" + response.getStatusLine().getStatusCode());
String jsonString = JsonParse.convertStreamToString(entity.getContent());
Updated by RaisingK