Skip to content

Commit 7c017e6

Browse files
author
Mark Adamcin
committed
updated readme to replace references to setRequestLine with references to setRequestTarget
1 parent 0d4486d commit 7c017e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ After selecting a key and building a RequestContent object, the client signs the
7373

7474
RequestContent.Builder requestContentBuilder = new RequestContent.Builder();
7575

76-
// call requestContentBuilder.setRequestLine(requestLine) then
76+
// call requestContentBuilder.setRequestTarget(method, path) then
7777
// for all request headers, requestContentBuilder.addHeader(name, value)...
7878

7979
Authorization authz = signer.sign(requestContentBuilder.build());
@@ -122,7 +122,7 @@ After parsing an Authorization and building the RequestContent object from the H
122122
if (authz != null) {
123123
RequestContent.Builder requestContentBuilder = new RequestContent.Builder();
124124

125-
// call requestContentBuilder.setRequestLine(requestLine) then
125+
// call requestContentBuilder.setRequestTarget(method, path) then
126126
// for all request headers, requestContentBuilder.addHeader(name, value)
127127

128128
if (verifier.verify(challenge, requestContentBuilder.build(), authz)) {
@@ -170,7 +170,7 @@ but this specification does not define a method by which a client and server may
170170
RequestContent
171171
--------------
172172

173-
The RequestContent class represents the sign-able portion of an HTTP Request. This includes the request line (as in "GET /some/page.html?foo=bar HTTP/1.1") and all of the request headers, excluding the "Authorization" header.
173+
The RequestContent class represents the sign-able portion of an HTTP Request. This includes the request target (as in "GET /some/page.html?foo=bar") and all of the request headers, excluding the "Authorization" header.
174174

175175
It is created using the RequestContent.Builder class:
176176

@@ -179,8 +179,8 @@ It is created using the RequestContent.Builder class:
179179

180180
RequestContent.Builder requestContentBuilder = new RequestContent.Builder();
181181

182-
// set the HTTP request line
183-
requestContentBuilder.setRequestLine("GET /index.html HTTP/1.1");
182+
// set the HTTP request target
183+
requestContentBuilder.setRequestTarget("GET", "/index.html");
184184

185185
// add each HTTP header in request order
186186
for (Map.Entry<String, String> header : headers.entrySet()) {

0 commit comments

Comments
 (0)