package com.sxyz.rfid.retrofit.http;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public class InterceptorUtil implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {

        Request request = chain.request();
        request = request.newBuilder()
                .header("Content-Type", "application/json")
                .header("Accept", "text/event-stream")
                .header("Connection", "keep-alive")
                .header("secret-key", "{your-secretKey}")
                .method(request.method(), request.body())
                .build();
        return chain.proceed(request);
    }

}
