Hello, gentlemen! I worked here with the API of the disk, everything went well until the authorization was sent from outside the SDK. Here they are asked to do this:
The resulting token should be passed in the Authorization header each time the Disk API is called, indicating the type of the token before its value. An example of such a header: Authorization: OAuth 0c4181a7c2cf4521964a72ff57a34a07
It would be good, but:
connection.setRequestMethod("POST"); connection.addRequestProperty("Authorization: OAuth", "0c4181a7c2cf4521964a72ff57a34a07"); Give an error:
java.lang.IllegalArgumentException: Illegal character(s) in message header field: Authorization: OAuth I understand that there is a mistake, but I can’t think of something from the morning how to solve it, because I have never transmitted almost any headers. Who can, prompt the decision, please. Thank you in advance!
Corrected code:
connection.addRequestProperty("Authorization", "OAuth 0c4181a7c2cf4521964a72ff57a34a07");