square/okhttp

Make status code a digit

Closed this issue · 3 comments

Is there any valid rease why the statuscode parameter is designed as String?

new MockResponse.Builder().status("200").build()

It would be way better to take an interger, like:

new MockResponse.Builder().status(200).build()

It represents the status line, which is both the code and reason components.

Use setResponseCode(200) instead

I discovered in java the method is call .code(int):
new MockResponse.Builder().code(401).build()