I would like to add custom headers to the HTTP package sent to an Endpoint. I've read that I can access the raw HTTP data in the Endpoint method (by adding a HttpServletRequest parameter). What I am looking for is a solution (or a hack) to access and modify the data being sent by the (Android) client.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- java.lang.NullPointerException at java.io.PrintWri
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Http headers can be modified like this. I use this link as example. Since it's one of the Google's example.
Read it and find EndpointsAsyncTask you can use GoogleClientRequestInitializer for this. inside
public void initialize(AbstractGoogleClientRequest abstractGoogleClientRequest) throws IOException
you can set headers like this.
In above code setDate() can be used to set Date header and set() method has been used to set my own header that can be read from server side. I have used calendar class to get date but Calendar class initialization is not shown here.
I have also write a note on my blog to show how it's actually reside in the method. if you like read that too.