@@ -19,92 +19,94 @@ class Client(
19
19
/* *
20
20
* Synchronous execution.
21
21
*/
22
- fun send (request : Request ): Response =
22
+ fun send (request : Request ): Response < String > =
23
23
adapter.send(this , request)
24
24
25
25
fun get (
26
26
path : String ,
27
27
headers : Map <String , List <String >> = emptyMap(),
28
28
body : Any? = null,
29
- contentType : String? = settings.contentType): Response =
29
+ contentType : String? = settings.contentType): Response < String > =
30
30
send(Request (GET , Path (path), body, headers = headers, contentType = contentType))
31
31
32
- fun head (path : String , headers : Map <String , List <String >> = emptyMap()): Response =
32
+ fun head (path : String , headers : Map <String , List <String >> = emptyMap()): Response < String > =
33
33
send(Request (HEAD , Path (path), null , headers = headers))
34
34
35
35
fun post (
36
- path : String , body : Any? = null, contentType : String? = settings.contentType): Response =
36
+ path : String ,
37
+ body : Any? = null,
38
+ contentType : String? = settings.contentType): Response <String > =
37
39
send(Request (POST , Path (path), body, contentType = contentType))
38
40
39
41
fun put (
40
42
path : String ,
41
43
body : Any? = null,
42
- contentType : String? = settings.contentType): Response =
44
+ contentType : String? = settings.contentType): Response < String > =
43
45
send(Request (PUT , Path (path), body, contentType = contentType))
44
46
45
47
fun delete (
46
48
path : String ,
47
49
body : Any? = null,
48
- contentType : String? = settings.contentType): Response =
50
+ contentType : String? = settings.contentType): Response < String > =
49
51
send(Request (DELETE , Path (path), body, contentType = contentType))
50
52
51
53
fun trace (
52
54
path : String ,
53
55
body : Any? = null,
54
- contentType : String? = settings.contentType): Response =
56
+ contentType : String? = settings.contentType): Response < String > =
55
57
send(Request (TRACE , Path (path), body, contentType = contentType))
56
58
57
59
fun options (
58
60
path : String ,
59
61
body : Any? = null,
60
62
contentType : String? = settings.contentType,
61
- headers : Map <String , List <String >> = emptyMap()): Response =
63
+ headers : Map <String , List <String >> = emptyMap()): Response < String > =
62
64
send(Request (OPTIONS , Path (path), body, headers, contentType = contentType))
63
65
64
66
fun patch (
65
67
path : String ,
66
68
body : Any? = null,
67
- contentType : String? = settings.contentType): Response =
69
+ contentType : String? = settings.contentType): Response < String > =
68
70
send(Request (PATCH , Path (path), body, contentType = contentType))
69
71
70
72
fun get (
71
73
path : String ,
72
74
headers : Map <String , List <String >> = emptyMap(),
73
75
body : Any ,
74
- format : SerializationFormat ): Response =
76
+ format : SerializationFormat ): Response < String > =
75
77
get(path, headers, body, format.contentType)
76
78
77
- fun post (path : String , body : Any , format : SerializationFormat ): Response =
79
+ fun post (path : String , body : Any , format : SerializationFormat ): Response < String > =
78
80
post(path, body, format.contentType)
79
81
80
82
fun put (
81
83
path : String ,
82
84
body : Any ,
83
- format : SerializationFormat ): Response =
85
+ format : SerializationFormat ): Response < String > =
84
86
put(path, body, format.contentType)
85
87
86
88
fun delete (
87
89
path : String ,
88
90
body : Any ,
89
- format : SerializationFormat ): Response =
91
+ format : SerializationFormat ): Response < String > =
90
92
delete(path, body, format.contentType)
91
93
92
94
fun trace (
93
95
path : String ,
94
96
body : Any ,
95
- format : SerializationFormat ): Response =
97
+ format : SerializationFormat ): Response < String > =
96
98
trace(path, body, format.contentType)
97
99
98
100
fun options (
99
101
path : String ,
100
102
body : Any ,
101
103
format : SerializationFormat ,
102
- headers : Map <String , List <String >> = emptyMap()): Response =
104
+ headers : Map <String , List <String >> = emptyMap()): Response < String > =
103
105
options(path, body, format.contentType, headers)
104
106
105
107
fun patch (
106
108
path : String ,
107
109
body : Any ,
108
- format : SerializationFormat ): Response =
110
+ format : SerializationFormat ): Response < String > =
109
111
patch(path, body, format.contentType)
110
112
}
0 commit comments