You can write this in a more compact form by reusing the return value of ```StringBuffer``` methods, e.g.,

```
String string = new StringBuffer()
    .append(method).append("\n")
    .append(endpoint).append("\n")
    ...
    .build()
```

And actually this is equivalent to just using + for concatenation.