android


RESTful Spring for Android POST request


I'm sending a GET request to a server.
private class DTOTask extends AsyncTask<Void, Void, DTO> {
#Override
protected DTO doInBackground(Void... params) {
RestTemplate template = new RestTemplate();
template.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
return template.getForObject(Constants.URL.GET_URL, DTO.class);
}
#Override
protected void onPostExecute(DTO dto) {
List<DTO> data = new ArrayList<>();
data.add(dto);
adapter.setData(data);
}
}
It works.
How to send POST request?
use any of this methods instead of getForObject
public <T> T postForObject(String url, Object request, Class<T> responseType, Object... uriVariables);
public <T> T postForObject(String url, Object request, Class<T> responseType, Map<String, ?> uriVariables);
public <T> T postForObject(URI url, Object request, Class<T> responseType) throws RestClientException;

Related Links

PayPal SecurityException: Requires READ_PHONE_STATE
Android RecyclerView auto srcoll to top
Radio Buttons in Menu using SharedPreferences
Android file execute
Android Activity being randomly Created and Destroyed
APK Icon Not Showing Upon Installation
Implement button as widget
Exists a way to capture 3 photos in a second with the camera in an Android application
Android max usb current
My RecyclerView only displays when I manually switch back from another app to my app
Constantly updating RecyclerView items
Android Studio how to automatically find the location of a generated .so file
Sorting Data in Firebase
Pull to Refreshing webview
How to create flipcard animation in gridview? [android]
Android getListView() change function to Gridview

Categories

HOME
phantom-dsl
azure-stream-analytics
facebook-oauth
twitter-bootstrap-3
amp-html
css3
character-encoding
jsf-2.2
grafana
bitbucket-api
retrofit2
trac
joomla3.0
datastage
jsonpath
spring-social
code-generation
heat
fileserver
vuejs
sse
dynamically-generated
xunit
8051
cppreference
mql
spring-security4
fossil
carriage-return
reverse
arduino-ide
linq-to-objects
urlsession
parser-generator
outputcache
robomongo
identification
payara-micro
dt
flac
cmp
slackware
adafruit
greatest-n-per-group
xdoclet
refinerycms
android-wake-lock
cda
turbo-prolog
highland.js
relativelayout
inf
sapi
phonertc
rubaxa-sortable
sony-lifelog-api
finalbuilder
skspritenode
dnssec
ansi
alloy-ui
nutiteq
mraid
mmwormhole
cross-join
infosphere-spl
variadic-templates
execve
mruby
filesplitting
deform
cbind
create.js
vsx
mt4j
bin
light
away3d
hidapi
cascadingdropdown
veracity
os.system
fusefabric
mapping-by-code
xcelsius
drawtobitmap
appledoc
metaweblog
uideviceorientation
globals
non-clustered-index
maven-1
dot-emacs
isapi-extension
glui
unmanagedresources

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App