OkHttp搞定Http请求

文章目录

OkHttp

官方文档 仓库

OkHttp是一款高效的HTTP客户端框架:

  • HTTP/2支持允许对同一主机的所有请求共享一个套接字。
  • 连接池可以减少请求延迟(如果HTTP/2不可用)。
  • 透明GZIP压缩下载大小。
  • 响应缓存完全避免了重复请求的网络。

当网络出现问题时,OkHttp会自动恢复一般的连接问题;若服务有多个IP地址,当第一个IP请求失败时,OkHttp会交替尝试你配置的其他IP。

OkHttp采用流式构造接口,方便调用;同时支持同步与异步方式调用。

依赖包

OkHttp3是OkHttp发展到版本3.0之后的名字。

要使用OkHttp,需要先在pom.xml中引入依赖包;okhttp3是使用kotlin实现的,所以对应包也需要引入:

<dependency>
    <groupId>com.squareup.okhttp3</groupId>
    <artifactId>okhttp</artifactId>
    <version>4.9.1</version>
</dependency>

<dependency>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-stdlib</artifactId>
    <version>1.5.0</version>
</dependency>

创建OkHttpClient

通过共享的响应缓存/线程池/复用的连接等,绝大多数应用只需一个OkHttpClient实例,便可以满足整个应用的所有Http请求。

OkHttpClient client = new OkHttpClient();

OkHttpClient httpClient = new OkHttpClient.Builder()
            .connectTimeout(60, TimeUnit.SECONDS) // default 10s
            .writeTimeout(30, TimeUnit.SECONDS)   // default 10s
            .readTimeout(30, TimeUnit.SECONDS)    // default 10s
            .build();

OkHttpClient anotherClient  = client.newBuilder().build();

构造Url

通过HttpUrl.Builder可方便地构造Url:

  • addPathSegment:添加路径;
  • addQueryParameter:添加请求参数,允许重复;
  • setQueryParameter:设定请求参数,覆盖重复;
  • username、password:添加用户名、密码;
public static HttpUrl buildUrl(String url, Map<String, String> queryParam) {
    HttpUrl.Builder builder = HttpUrl.parse(url).newBuilder();
    queryParam.forEach((k, v) -> {
        builder.addQueryParameter(k, v);
    });

    return builder.build();
}

构造完整Url的流程:

HttpUrl.Builder builder = new HttpUrl.Builder()
        .host("127.0.0.1")
        .port(8001)
        .addPathSegment("seg1")
        .addPathSegment("path2")
        .username("user")
        .password("pass")
        .scheme("https")
        .addQueryParameter("k1", "v1")
        .addQueryParameter("k1", "v2")
        .setQueryParameter("uk", "v1")
        .setQueryParameter("uk", "v2");

HttpUrl http = builder.build();
System.out.println(http.toString());
// https://user:pass@127.0.0.1:8001/seg1/path2?k1=v1&k1=v2&uk=v2

Header头设定

HTTP头(可参见请求头大全)是 Map<String, List<String>>类型。也就是说,对于每个 HTTP 头,可能有多个值;但是大部分 HTTP 头都只有一个值。

OkHttp中通过Request构造时添加:

  • header(name,value):设置HTTP头的唯一值,若请求已经存在则替换掉。
  • addHeader(name,value):添加新值,若请求头中已经存在此name还会继续添加(此时,请求头中便会存在多个name相同而value不同的“键值对”)。
  • header(name):读取唯一值或多个值的最后一个值
  • headers(name):获取所有值

构造Request时,必须设定Url,默认是GET模式:

Request request = new Request.Builder()
        .url("http://127.0.0.1")
        .addHeader("h1", "v1")
        .addHeader("h1", "v2")
        .header("uh", "v1")
        .header("uh", "v2")
        .build();
System.out.println(request.toString());
// Request{method=GET, url=http://127.0.0.1/, headers=[h1:v1, h1:v2, uh:v2]}

请求示例

使用OkHttp,需要:

  • 构造OkHttpClient对象;
  • 构造Request对象;
  • 构造Call对象;
  • 发起请求:execute同步;enqueue异步;
  • 返回Response:不可修改的Http相应对象。

Get请求

Request默认就是Get请求,所以构造时可以省略GetGet请求参数通过queryParameter添加。

同步Get

通过newCall会同步调用,其返回内容可通过body来获取;

private static void getSync() throws IOException {
    String url = "http://wwww.baidu.com";
    Request request = new Request.Builder()
            .url(url) // 可以字符串,也可以是HttpUrl
            .build();
    Call call = httpClient.newCall(request);
    Response resp = call.execute();
    if (resp.code() == 200) {
        System.out.println("Response: " + resp.body().string());
    } else {
        // Error handle
        System.out.println("Code:" + resp.code() + ", Msg:" + resp.message());
    }
}

异步Get

通过enqueue,可提交异步请求;请求的应答通过回调Callback返回。

private static void getAsync() {
    HttpUrl url = buildUrl("http://127.0.0.1:7087/study/test/testEvent",
            new HashMap<String, String>(){{
                put("msg", "Test Msg event");
            }});
    // http://127.0.0.1:7087/study/test/testEvent?msg=Test%20Msg%20event
    Request request = new Request.Builder()
            .url(url)
            .get()  //默认就是GET请求,可以不写
            .build();
    Call call = httpClient.newCall(request);
    call.enqueue(new Callback() {
        @Override
        public void onFailure(Call call, IOException e) {
            System.out.println("Fail: " + e.getMessage());
        }

        @Override
        public void onResponse(Call call, Response resp) throws IOException {
            System.out.println("onResponse: " + resp.body().string());
        }
    });
}

Post请求

Request中通过Post来标识Post请求,并设定PostBody内容。

Json内容

Json是常用的序列化方式,只需把要传递的对象序列化为Json字符串,然后以字符串Body的方式传递到服务端。

private static void postJsonBody() throws IOException {
    MediaType mediaType = MediaType.parse("application/json;charset=UTF-8");
    RequestBody reqBody = RequestBody.create("msg for test", mediaType);
    Request request = new Request.Builder()
            .url("http://127.0.0.1:7087/study/test/postMsg")
            .post(reqBody)
            .build();
    Response resp = httpClient.newCall(request).execute();
    System.out.println("Response: " + resp.body().string());
}

Form表单

Form表单都是以键值对的方式传递内容到服务端的,通过FormBody可方便地构造。

private static void postFormBody() throws IOException {
    RequestBody reqBody = new FormBody.Builder()
            .add("msg", "form test")
            .add("others", "other params")
            .build();
    Request request = new Request.Builder()
            .url("http://127.0.0.1:7087/study/test/formMsg")
            .post(reqBody)
            .build();
    Response resp = httpClient.newCall(request).execute();
    System.out.println("Response: " + resp.body().string());
}

文件上传

上传文件时,使用MultipartBody,并可通过MediaType来设定媒体类型:

private static void uploadOneFile() throws IOException {
    File file = new File("D:\\tmp\\Python-learning.md");
    MediaType mediaType = MediaType.parse("application/octet-stream"); //设置类型为八位字节流
    RequestBody reqBody = RequestBody.create(file, mediaType);

    MultipartBody multiBody = new MultipartBody.Builder()
            .setType(MultipartBody.FORM)
            .addFormDataPart("id", "0") // for test
            .addFormDataPart("file", file.getName(), reqBody)
            .build();

    Request request = new Request.Builder()
//            .header("Authorization", "Bearer ****************") //添加请求头的身份认证Token
            .url("http://127.0.0.1:7087/study/test/uploadFile")
            .post(multiBody)
            .build();
    Response resp = httpClient.newCall(request).execute();
    System.out.println("Response: " + resp.body().string());
}

要上传多个文件,就需要构造多份文件相关的RequestBody,然后依次添加到MultipartBody中:

private static void uploadMultiFile() throws IOException {
    List<String> lstFile = Lists.newArrayList("D:\\tmp\\Python-learning.md", "D:\\tmp\\WebRTC-Learning.md");
    MediaType mediaType = MediaType.parse("application/octet-stream"); //设置类型为八位字节流

    MultipartBody.Builder multiBody = new MultipartBody.Builder()
            .setType(MultipartBody.FORM);
    for(String f : lstFile){
        File file = new File(f);
        RequestBody fileBody = RequestBody.create(file, mediaType);
        multiBody.addFormDataPart("file", file.getName(), fileBody);
    }

    Request request = new Request.Builder()
            .url("http://127.0.0.1:7087/study/test/uploadMultiFile")
            .post(multiBody.build())
            .build();
    Response resp = httpClient.newCall(request).execute();
    System.out.println("Response: " + resp.body().string());
}

Put请求

PutPost类似,只是Request时用Put标识。

Json内容

以传递Json格式的Body为例:

MediaType mediaType = MediaType.parse("application/json;charset=UTF-8");
RequestBody reqBody = RequestBody.create("{\"page\":0,\"query\":\"info to query\",\"size\":0}", mediaType);

Request request = new Request.Builder()
        .url("http://127.0.0.1:7087/study/test/testPut")
        .put(reqBody)
        .build();
Response resp = httpClient.newCall(request).execute();
System.out.println("Response: " + resp.body().string());

参数方式

通过参数来传递请求的内容;但是Put要求必须传递Body,此时可构造一个空Body

HttpUrl url = buildUrl("http://127.0.0.1:7087/study/test/paramPut",
        new HashMap<String, String>() {{
            put("msg", "Test Msg event");
            put("others", "other params");
        }});
RequestBody reqBody = RequestBody.create(new byte[]{}, null);
Request request = new Request.Builder()
        .url(url)
        .put(reqBody)
        .build();
Response resp = httpClient.newCall(request).execute();
System.out.println("Response: " + resp.body().string());

Delete请求

Request中通过Delete来标识请求,默认是通过参数方式的,也可通过RequestBody来传递。

HttpUrl url = buildUrl("http://127.0.0.1:7087/study/test/testDelete",
        new HashMap<String, String>() {{
            put("id", "delId");
        }});
Request request = new Request.Builder()
        .url(url)
        .delete()
        .build();
Response resp = httpClient.newCall(request).execute();
System.out.println("Response: " + resp.body().string());

OkHttp工具类

下面是一个封装的工具类,里边包含了日常用到的一些请求方式 和 日志打印 http异常捕获,可以根据实际需要进行裁剪使用

HttpUtil.java

package org.example.utils;

import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.lang3.StringUtils;
import org.example.exception.HttpStatusException;
import org.springframework.http.HttpStatus;
import org.springframework.util.CollectionUtils;

import java.io.File;
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.*;
import java.util.concurrent.TimeUnit;

@Slf4j
public class HttpUtil {

    private static OkHttpClient client;

    private static final String DEFAULT_MEDIA_TYPE = "application/json; charset=utf-8";

    private static final int CONNECT_TIMEOUT = 5;

    private static final int READ_TIMEOUT = 7;

    private static final String GET = "GET";

    private static final String POST = "POST";

    /**
     * 单例模式  获取类实例
     *
     * @author: yh
     * @date: 2022/12/1
     */
    private static OkHttpClient getInstance() {
        if (client == null) {
            synchronized (OkHttpClient.class) {
                if (client == null) {
                    client = new OkHttpClient.Builder()
                            // 设置默认连接超时时间。值为0表示没有超时,否则值必须在1和Integer之间
                            .connectTimeout(60, TimeUnit.SECONDS)
                            // 设置新连接的默认写超时时间。值为0表示没有超时,否则值必须在1和Integer之间
                            .writeTimeout(30, TimeUnit.SECONDS)
                            // 设置新连接的默认读超时时间。值为0表示没有超时,否则值必须在1和Integer之间
                            .readTimeout(30, TimeUnit.SECONDS)
                            .build();
                }
            }
        }
        return client;
    }

    /**
     * 构造 Url
     *
     * @param url        请求路径
     * @param queryParam 参数
     * @return HttpUrl
     */
    public static HttpUrl buildUrl(String url, Map<String, String> queryParam) {
        HttpUrl.Builder builder = HttpUrl.parse(url).newBuilder();
        // addPathSegment:添加路径;
        // addQueryParameter:添加请求参数,允许重复;
        // setQueryParameter:设定请求参数,覆盖重复;
        // username、password:添加用户名、密码;
        queryParam.forEach(builder::addQueryParameter);
        return builder.build();
    }

    /**
     * 普通 GET 请求
     *
     * @param url 请求路径
     * @return response
     * @author: yh
     * @date: 2022/12/1
     */
    public static String doGet(String url) {
        try {
            long startTime = System.currentTimeMillis();
//            addRequestLog(GET, url, null, null);
            Request request = new Request.Builder().url(url).build();
            // 创建一个请求
            Response response = getInstance().newCall(request).execute();
            int httpCode = response.code();
            String result;
            ResponseBody body = response.body();
            if (body != null) {
                result = body.string();
//                addResponseLog(httpCode, result, startTime);
            } else {
                throw new RuntimeException("exception in OkHttpUtil,response body is null");
            }
            return handleHttpResponse(httpCode, result);
        } catch (Exception ex) {
            handleHttpThrowable(ex, url);
            return StringUtils.EMPTY;
        }
    }

    /**
     * 携带 HEADER 的 GET 请求
     *
     * @param url     请求路径
     * @param headers 请求头
     * @return response
     * @author: yh
     * @date: 2022/12/1
     */
    public static String doGet(String url, Headers headers) {
        try {
            long startTime = System.currentTimeMillis();
//            addRequestLog(GET, url, null, null);
            Request request = new Request.Builder().url(url).headers(headers).build();
            // 创建一个请求
            Response response = getInstance().newCall(request).execute();
            int httpCode = response.code();
            String result;
            ResponseBody body = response.body();
            if (body != null) {
                result = body.string();
//                addResponseLog(httpCode, result, startTime);
            } else {
                throw new RuntimeException("exception in OkHttpUtil,response body is null");
            }
            return handleHttpResponse(httpCode, result);
        } catch (Exception ex) {
            handleHttpThrowable(ex, url);
            return StringUtils.EMPTY;
        }
    }

    /**
     * POST 普通请求
     *
     * @param url       请求路径
     * @param postBody  参数
     * @param mediaType mediaType 默认:json
     * @return response
     * @author: yh
     * @date: 2022/12/1
     */
    public static String doPost(String url, String postBody, String mediaType){
        try {
            long startTime = System.currentTimeMillis();
//            addRequestLog(POST, url, postBody, null);

            MediaType createMediaType = MediaType.parse(mediaType == null ? DEFAULT_MEDIA_TYPE : mediaType);
            Request request = new Request.Builder()
                    .url(url)
                    .post(RequestBody.create(createMediaType, postBody))
                    .build();

            Response response = getInstance().newCall(request).execute();
            int httpCode = response.code();
            String result;
            ResponseBody body = response.body();
            if (body != null) {
                result = body.string();
//                addResponseLog(httpCode, result, startTime);
            } else {
                throw new IOException("exception in OkHttpUtil,response body is null");
            }
            return handleHttpResponse(httpCode, result);
        } catch (Exception ex) {
            handleHttpThrowable(ex, url);
            return StringUtils.EMPTY;
        }
    }

    /**
     * POST 表单提交
     *
     * @param url          请求路径
     * @param parameterMap 请求参数
     * @return response
     * @author: yh
     * @date: 2022/12/1
     */
    public static String doPost(String url, Map<String, String> parameterMap) {
        try {
            long startTime = System.currentTimeMillis();
//            List<String> parameterList = new ArrayList<>();
            FormBody.Builder builder = new FormBody.Builder();
            if (parameterMap.size() > 0) {
                for (Map.Entry<String, String> entry : parameterMap.entrySet()) {
                    String parameterName = entry.getKey();
                    String value = entry.getValue();
                    builder.add(parameterName, value);
//                    parameterList.add(parameterName + ":" + value);
                }
            }
//            addRequestLog(POST, url, null, Arrays.toString(parameterList.toArray()));

            FormBody formBody = builder.build();
            Request request = new Request.Builder()
                    .url(url)
                    .post(formBody)
                    .build();

            Response response = getInstance().newCall(request).execute();
            String result;
            int httpCode = response.code();
            ResponseBody body = response.body();
            if (body != null) {
                result = body.string();
                addResponseLog(httpCode, result, startTime);
            } else {
                throw new IOException("exception in OkHttpUtil,response body is null");
            }
            return handleHttpResponse(httpCode, result);

        } catch (Exception ex) {
            handleHttpThrowable(ex, url);
            return StringUtils.EMPTY;
        }
    }

    /**
     * POST 上传单个文件
     *
     * @param url  请求路径
     * @param file 文件
     * @return response
     * @author: yh
     * @date: 2022/12/1
     */
    public static String uploadFile(String url, File file) {
        try {
            //设置类型为八位字节流
            MediaType mediaType = MediaType.parse("application/octet-stream");
            RequestBody reqBody = RequestBody.create(file, mediaType);

            MultipartBody multiBody = new MultipartBody.Builder()
                    .setType(MultipartBody.FORM)
                    // 设置参数
                    .addFormDataPart("id", "0")
                    .addFormDataPart("file", file.getName(), reqBody)
                    .build();

            Request request = new Request.Builder()
                    .url(url)
                    .post(multiBody)
                    .build();

            Response response = getInstance().newCall(request).execute();
            String result;
            int httpCode = response.code();
            ResponseBody body = response.body();
            if (body != null) {
                result = body.string();
            } else {
                throw new IOException("exception in OkHttpUtil,response body is null");
            }
            return handleHttpResponse(httpCode, result);

        } catch (Exception ex) {
            handleHttpThrowable(ex, url);
            return StringUtils.EMPTY;
        }
    }

    /**
     * POST 上传多个文件
     *
     * @param url   请求路径
     * @param files 文件集合
     * @return response
     * @author: yh
     * @date: 2022/12/1
     */
    public static String uploadMultiFile(String url, List<File> files) {
        try {
            //设置类型为八位字节流
            MediaType mediaType = MediaType.parse("application/octet-stream");

            MultipartBody.Builder multiBody = new MultipartBody.Builder()
                    .setType(MultipartBody.FORM);
            for (File file : files) {
                RequestBody fileBody = RequestBody.create(file, mediaType);
                multiBody.addFormDataPart("file", file.getName(), fileBody);
            }

            Request request = new Request.Builder()
                    .url(url)
                    .post(multiBody.build())
                    .build();

            Response response = getInstance().newCall(request).execute();
            String result;
            int httpCode = response.code();
            ResponseBody body = response.body();
            if (body != null) {
                result = body.string();
            } else {
                throw new IOException("exception in OkHttpUtil,response body is null");
            }
            return handleHttpResponse(httpCode, result);

        } catch (Exception ex) {
            handleHttpThrowable(ex, url);
            return StringUtils.EMPTY;
        }
    }

    /**
     * PUT 提交
     *
     * @param url       请求路径
     * @param jsonParam 请求参数
     * @return response
     * @author: yh
     * @date: 2022/12/1
     */
    public static String doPut(String url, String jsonParam) {
        try {
            MediaType mediaType = MediaType.parse("application/json;charset=UTF-8");
            RequestBody reqBody = RequestBody.create(jsonParam, mediaType);

            Request request = new Request.Builder()
                    .url(url)
                    .put(reqBody)
                    .build();

            Response response = getInstance().newCall(request).execute();
            String result;
            int httpCode = response.code();
            ResponseBody body = response.body();
            if (body != null) {
                result = body.string();
            } else {
                throw new IOException("exception in OkHttpUtil,response body is null");
            }
            return handleHttpResponse(httpCode, result);

        } catch (Exception ex) {
            handleHttpThrowable(ex, url);
            return StringUtils.EMPTY;
        }
    }

    /**
     * PUT 提交
     *
     * @param url      请求路径
     * @param paramMap 请求参数 Map类型
     * @return response
     * @author: yh
     * @date: 2022/12/1
     */
    public static String doPut(String url, Map<String, String> paramMap) {
        try {
            HttpUrl httpUrl = buildUrl(url, paramMap);
            RequestBody reqBody = RequestBody.create(new byte[]{}, null);

            Request request = new Request.Builder()
                    .url(httpUrl)
                    .put(reqBody)
                    .build();

            Response response = getInstance().newCall(request).execute();
            String result;
            int httpCode = response.code();
            ResponseBody body = response.body();
            if (body != null) {
                result = body.string();
            } else {
                throw new IOException("exception in OkHttpUtil,response body is null");
            }
            return handleHttpResponse(httpCode, result);

        } catch (Exception ex) {
            handleHttpThrowable(ex, url);
            return StringUtils.EMPTY;
        }
    }

    /**
     * DELETE 请求
     *
     * @param url      请求路径
     * @param paramMap 请求参数 Map类型
     * @return response
     * @author: yh
     * @date: 2022/12/1
     */
    public static String doDelete(String url, Map<String, String> paramMap) {
        try {
            HttpUrl httpUrl = buildUrl(url, paramMap);

            Request request = new Request.Builder()
                    .url(httpUrl)
                    .delete()
                    .build();

            Response response = getInstance().newCall(request).execute();
            String result;
            int httpCode = response.code();
            ResponseBody body = response.body();
            if (body != null) {
                result = body.string();
            } else {
                throw new IOException("exception in OkHttpUtil,response body is null");
            }
            return handleHttpResponse(httpCode, result);

        } catch (Exception ex) {
            handleHttpThrowable(ex, url);
            return StringUtils.EMPTY;
        }
    }

    /**
     * 请求前记录日志
     *
     * @param method
     * @param url
     * @param body
     * @param formParam
     * @author: yh
     * @date: 2022/12/1
     */
    private static void addRequestLog(String method, String url, String body, String formParam) {
        log.info("===========================request begin================================================");
        log.info("URI          : {}", url);
        log.info("Method       : {}", method);
        if (StringUtils.isNotBlank(body)) {
            log.info("Request body : {}", body);
        }
        if (StringUtils.isNotBlank(formParam)) {
            log.info("Request param: {}", formParam);
        }
        log.info("---------------------------request end--------------------------------------------------");
    }

    /**
     * 请求成功响应日志
     *
     * @param httpCode  状态码
     * @param result    请求结果
     * @param startTime 请求前计时
     * @author: yh
     * @date: 2022/12/1
     */
    private static void addResponseLog(int httpCode, String result, long startTime) {
        long endTime = System.currentTimeMillis();
        log.info("Status       : {}", httpCode);
        log.info("Response     : {}", result);
        log.info("Time         : {} ms", endTime - startTime);
        log.info("===========================response end================================================");
    }

    /**
     * 状态码不为 200 抛出异常
     *
     * @param httpCode 响应状态码
     * @param result   响应结果
     * @return 响应结果
     * @author: yh
     * @date: 2022/12/1
     */
    private static String handleHttpResponse(int httpCode, String result) throws HttpStatusException {
        if (httpCode == HttpStatus.OK.value()) {
            return result;
        }
        HttpStatus httpStatus = HttpStatus.valueOf(httpCode);
        throw new HttpStatusException(httpStatus);
    }

    /**
     * 打印 异常信息
     *
     * @param ex  异常
     * @param url 请求的路径
     * @author: yh
     * @date: 2022/12/1
     */
    private static void handleHttpThrowable(Exception ex, String url) {
        if (ex instanceof HttpStatusException) {
//            throw (HttpStatusException) ex;
            log.error("OkHttp exception: " + ex.getMessage());
        }
        log.error("OkHttp error url: " + url, ex);
        if (ex instanceof SocketTimeoutException) {
            throw new RuntimeException("request time out of OkHttp when do url:" + url);
        }
        throw new RuntimeException(ex);
    }

}

Http请求异常类:HttpStatusException.java

package org.example.exception;

import org.springframework.http.HttpStatus;

/**
 * 异常类
 * @author: yh
 * @date: 2022/12/1
 */
public class HttpStatusException extends Exception {

    private HttpStatus httpStatus;

    private String result;

    public HttpStatusException(HttpStatus httpStatus) {
        this.httpStatus = httpStatus;
    }
    public HttpStatusException(HttpStatus httpStatus, String result) {
        this.httpStatus = httpStatus;

    }
    public HttpStatus getHttpStatus() {
        return httpStatus;
    }
    public String getResult() {
        return result;
    }
}

调用示例:

// GET 请求携带请求头
Headers headers = new Headers.Builder().add("token", "123456").build();
String s = HttpUtil.doGet("https://127.0.0.1/test", headers);
System.out.println(s);
// ......


到此,本章内容就介绍完啦,如果有帮助到你 欢迎点个赞👍👍吧!!您的鼓励是博主的最大动力! 有问题评论区交流。

本文转自 https://blog.csdn.net/weixin_43847283/article/details/128172272?spm=1001.2100.3001.7377&utm_medium=distribute.pc_feed_blog_category.none-task-blog-classify_tag-15-128172272-null-null.nonecase&depth_1-utm_source=distribute.pc_feed_blog_category.none-task-blog-classify_tag-15-128172272-null-null.nonecase,如有侵权,请联系删除。

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,324评论 5 476
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,303评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,192评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,555评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,569评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,566评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,927评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,583评论 0 257
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,827评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,590评论 2 320
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,669评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,365评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,941评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,928评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,159评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,880评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,399评论 2 342

推荐阅读更多精彩内容