All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlin-spring.libraries.spring-cloud.apiKeyRequestInterceptor.mustache Maven / Gradle / Ivy

There is a newer version: 7.6.0
Show newest version
package {{configPackage}}

import feign.RequestInterceptor
import feign.RequestTemplate

class ApiKeyRequestInterceptor(
    private val location: String,
    private val name: String,
    private val value: String,
) : RequestInterceptor {

    override fun apply(requestTemplate: RequestTemplate) {
        if (location == "header") {
            requestTemplate.header(name, value)
        } else if (location == "query") {
            requestTemplate.query(name, value)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy