Back to project page Broadsheet.ie-Android.
The source code is released under:
Copyright (c) 2013 Karl Monaghan (http://karlmonaghan.com/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Soft...
If you think the Android project Broadsheet.ie-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ie.broadsheet.app.requests; /* w w w .j av a 2 s.co m*/ import ie.broadsheet.app.model.json.SinglePost; import android.util.Log; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpRequest; import com.google.api.client.json.jackson.JacksonFactory; import com.octo.android.robospice.request.googlehttpclient.GoogleHttpClientSpiceRequest; public class PostRequest extends GoogleHttpClientSpiceRequest<SinglePost> { private static final String TAG = "PostRequest"; private String url; public PostRequest(String url) { super(SinglePost.class); this.url = url + "?json=1"; } @Override public SinglePost loadDataFromNetwork() throws Exception { Log.d(TAG, url); HttpRequest request = getHttpRequestFactory().buildGetRequest(new GenericUrl(url)); request.setParser(new JacksonFactory().createJsonObjectParser()); return request.execute().parseAs(getResultType()); } }