Widevine android framework DrmInfoRequest send as HTTP POST - android

When I use the widevine android framework and I try to call DrmInfoRequest I need it to send it as a HTTP POST and it keeps sending it as a HTTP GET requet, is there anyway to change this behavior (any parameter to set in the call, configuration)?
I have to have it as a POST for my server.

After a lock of fidgeting we ended up putting some data in the payload and this made it send it as POST.

Related

Parsing SAP web service in Android or iOS

I want to parse the web service in Android/iOS, Which is
written in SAP, but not able to do that. Can I do this ? and How?
When I hit the request on browser I get this popup and after entering the valid details here then only i get the JSON response, But how to get this done in mobile development?
Thank you..
Add Authorization header to your request
Authorization: Basic <Base64of Username:Password>
For quick check, you can generate auth header here
You can try using PostMan chrome plugin to generate request and play with different set of input data.

Sending Android app id in HTTP referrer header

I thought I had read somewhere a while ago that Android apps send their id in HTTP requests made from within the app.
I seemed to remember that the id was sent as the HTTP referrer.
I cannot, however, find any mention of this anywhere now.
Did I dream it, or is the id sent somewhere else?
(I understand the unreliability and spoofability of the HTTP referrer header)
Is there any other way to identify which app is making a request to an HTTP server?
I am not sure if your question is generic or for all http requests.
I think following link can help you
https://cloud.google.com/appengine/docs/java/appidentity/

Android: HttpUrlConnection uses POST to send request bodys (instead of GET)

I'm developing an Android application which communicates with (our own) API. It was meant to use the API in manipulative requests with the request method POST and at not-manipulative requests GET (as it should be in RESTful applications).
To authenticate or add parameters to the request, the HTTP request body has been used (in both GET and POST requests). (YES, it is possible and allowed to add a request body to GET requests per HTTP definition (see e.g. this post)). The post generally says, that it is possible to add a request body, but the server may not use it during the request.
The problem is, that the request method is always set to POST, no mather if I set it to GET anywhere during the connection configuration, even if the getRequestMethod does return GET after setting it to GET via setRequestMethod("GET").
The android application uses the HttpsURLConnection (which is an extended class from HttpURLConnection, so it should behave similary).
By calling these methods, a request body will be attended:
https.setDoInput(true);
OutputStream os = https.getOutputStream();
os.write(outputInBytes);
os.close();
And by calling https.setRequestMethod("GET"), the request method should be set to GET.
After a little investigating, the line OutputStream os = https.getOutputStream(); sets the request method to POST, afterwards I set it to GET again and it remains GET till the end of the connection (as returned by https.getRequestMethod())
But in the end the server receives the request with the request method POST.
So my specific questions are:
Is there a possible workaround / solution for this problem?
Is it really that bad to add a request body to a GET request?
Currently I have just set all requests to POST, so there is no problem with it (and I wouldn't have a problem to leave it this way, but for several reasons I would like to know for sure that there is no other way to fix this problem)
Edit: The documentation of the getOutputStream() method says:
The default request method changes to "POST" when this method is called.
By default the HttpURLConnection is a GET Method (getDoInput() is true by default).
If you use setDoOutput(true) it will become a POST method.
If you need another method (PUT, DELETE, etc...) then you will use setRequestMethod(string).
And of course you have to select the method you want before the connect() method

SignalR Android and Headers

I used to use HTTP Headers to pass some authentication data from my SignalR Client (Android) to our SignalR.
After updating my project to use the lastest source from GitHub, this technique has stopped working.
After some research, I noted that this happens because the new default transport used is websocket, and websocket donĀ“t allow us to use Http Headers.
So,
Is there any way to use HTTP Headers with SignalR and WebSockets transport?
If no, how could I pass some parameters to my server? Is there any other option available than using QueryStrings?
Thanks!
In general you should be able to set headers in the client and it should send them to the server when the websocket is being opened (the connect request). Not sure what client you use but this this is possible when for sure with C# client. However, as opposed to other transports, sending or receiving messages when using websockets does not require creating new HTTP requests and therefore if you set headers after the websocket is opened they won't be sent to the server until the next time the client has to send an HTTP request which is either when the client needs to reconnect or when the connection is stopped.
Another option (if your client does not support headers for websockets) is to send parameters using query string. On the server side you can get the request using the HubCallerContext.Request property which allows you accessing the query string like this (you can also read cookies the same way):
Context.Request.QueryString
Again, query string will only be sent to the server if the client is making an HTTP request, which in case of websockets after the connection is established happens when the connection is reconnecting or is being stopped.
Finally, you already have a connection to the server so maybe you can just send your parameters using this connection which should work regardless of the transport you are using.

get push stream in response send by server push with OkHttp

I am trying to test the push response from a server which support HTTP2 Server with an android app (Os=Android KitKat) . The server push another ressources(pictures) after a http request for index.html.
I don't know how to access to push stream (picture). I have done capture on server and it send the push stream. But the client (Okhttp 2.1.0) always send a frame RST_STREAM and just return the index page content .
I just start use okhttp and would like to know how to acces push stream from Okhttpclient response ? I have read that that it exist API for handle push stream from HTTP2. is it available in Okhttp 2.1.0 or Okhttp 2.2.0?
Thanks.
OkHttp doesn't implement pushed streams yet. When we do, it'll likely be to push into the cache only.

Categories

Resources