fix: mess code in Microsoft login page. Closes #981.

This commit is contained in:
huanghongxun
2021-08-28 16:27:27 +08:00
parent 96e6554b37
commit cc868656a8
5 changed files with 21 additions and 14 deletions

View File

@@ -57,10 +57,6 @@ public abstract class HttpRequest {
return header("Authorization", token);
}
public HttpRequest contentType(String contentType) {
return header("Content-Type", contentType);
}
public HttpRequest header(String key, String value) {
headers.put(key, value);
return this;
@@ -109,6 +105,11 @@ public abstract class HttpRequest {
super(url, "POST");
}
public HttpPostRequest contentType(String contentType) {
headers.put("Content-Type", contentType);
return this;
}
public HttpPostRequest json(Object payload) throws JsonParseException {
return string(payload instanceof String ? (String) payload : GSON.toJson(payload), "application/json");
}