本文整理匯總了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/");
}