本文整理汇总了Java中com.squareup.okhttp.mockwebserver.RecordedRequest.getHeader方法的典型用法代码示例。如果您正苦于以下问题:Java RecordedRequest.getHeader方法的具体用法?Java RecordedRequest.getHeader怎么用?Java RecordedRequest.getHeader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.squareup.okhttp.mockwebserver.RecordedRequest
的用法示例。
在下文中一共展示了RecordedRequest.getHeader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertRequestContainsHeader
import com.squareup.okhttp.mockwebserver.RecordedRequest; //导入方法依赖的package包/类
protected void assertRequestContainsHeader(String key, String expectedValue, int requestIndex)
throws InterruptedException {
RecordedRequest recordedRequest = getRecordedRequestAtIndex(requestIndex);
String value = recordedRequest.getHeader(key);
assertEquals(expectedValue, value);
}
示例2: RecordedUpload
import com.squareup.okhttp.mockwebserver.RecordedRequest; //导入方法依赖的package包/类
public RecordedUpload(RecordedRequest request) {
this.request = request;
this.contentType = request.getHeader("content-type");
this.charset = HttpUtil.getChartset(request).name();
}
示例3: isMultipartContent
import com.squareup.okhttp.mockwebserver.RecordedRequest; //导入方法依赖的package包/类
public static boolean isMultipartContent(RecordedRequest request){
String contentType = request.getHeader("content-type");
return contentType!=null&&"POST".equalsIgnoreCase(request.getMethod()) && contentType.startsWith("multipart/");
}