Android Question OPTIONS rather than GET PUT and POST in OkhttpUtils2?

nwhitfield

Active Member
Licensed User
Longtime User
The OPTIONS header usually just gets information about a resource, rather than actually being part of a transaction. Presumably you're getting the packets by snooping on an existing app or service?

I would hazard a guess that it's using OPTIONS to allow whatever's talking to the server to determine something like which version of a protocol or server is being used, and if it got some other response, then it would be amending the subsequent data packets appropriately.

So, in the absence of having full documentation of the protocol, I would think you can probably omit the OPTIONS request, and simply build your code around the other data sent and received.

Of course, if it's using OPTIONS as part of a CORS request ( https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS ) things might be slightly different.
 
Upvote 0
Top