我有以下方法来获取我的端点的实例。我想在它中添加标题。我怎么做?请修改我的代码,包括标题位。感谢。
<select name='by_type' value='' id='form-field-select-3' class='form-control search-select' data-placeholder='By' required onchange="select_division();"><option></option>
<option value="division">Division</option>
<option value="name">Name</option>
</select>
答案 0 :(得分:1)
你应该可以这样做:
@Override
public void initialize(AbstractGoogleClientRequest<?> request) throws IOException {
HttpHeaders yourHeaders = new HttpHeaders();
header.set("yourHeader", value);
// ...
request.setDisableGZipContent(true);
request.setRequestHeaders(yourHeaders); // setting the headers
}