forked from square/retrofit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
adriancole
committed
May 9, 2013
1 parent
f844530
commit 39f0341
Showing
8 changed files
with
265 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2013 Square, Inc. | ||
package retrofit.http; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
/** | ||
* Replaces the header with the the value of its target. If the target is null, | ||
* the header is removed. | ||
* | ||
* <p/> | ||
* ex. | ||
* | ||
* <pre> | ||
* @GET("/") | ||
* void foo(@Header("Auth-Token") String token, ..); | ||
* </pre> | ||
* | ||
* @author Adrian Cole ([email protected]) | ||
*/ | ||
@Retention(RUNTIME) @Target(PARAMETER) | ||
public @interface Header { | ||
String value(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2013 Square, Inc. | ||
package retrofit.http; | ||
|
||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Adds headers literally supplied in the {@code value}. | ||
* | ||
* <p/> | ||
* ex. | ||
* | ||
* <pre> | ||
* @Headers("Cache-Control: max-age=640000") | ||
* @GET("/") | ||
* ... | ||
* | ||
* @Headers({ | ||
* "X-Foo: Bar", | ||
* "X-Ping: Pong" | ||
* }) | ||
* @GET("/") | ||
* ... | ||
* </pre> | ||
* | ||
* @author Adrian Cole ([email protected]) | ||
*/ | ||
@Target(METHOD) @Retention(RUNTIME) | ||
public @interface Headers { | ||
String[] value(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.