#Authorization request property seems to be omitted

6 messages · Page 1 of 1 (latest)

coral copper
#
import java.net.URL;

public class test {

    public static void main(String[] args) throws Throwable {
        var conn = new URL("http://ree").openConnection();
        conn.setRequestProperty("Authorization1", "test 1");
        conn.setRequestProperty("Authorization", "test");
        conn.setRequestProperty("Authorization2", "test 2");
        System.out.println(conn.getRequestProperties());
    }

}

results in

{Authorization1=[test 1], Authorization2=[test 2]}

The Authorization request property seems to be omitted.
Why does this happen and how do i fix that?

delicate basaltBOT
#

Hey, @coral copper!
Please remember to /close this post once your question has been answered!

wanton magnet
#

you can do authentication like that

coral copper
#

ah ok thanks