Hi,
I am new to Gatling and Scala. My team is looking into using Gatling for our performance testing. I have been looking at the Signature Calculator API and see how I can use to register user and create a token but what I am reading here: http://gatling.io/docs/2.0.0/http/http_request.html#http-headers is a bit confusing to me. Do I need create a trait for Signature Calculator in my project and then call it somewhere in the simulation? Or how do I go about it? Can someone help me understand how this work? Some examples will be highly appreciated.
This is what I have attempted so far as I read Gatling documents: (Right now I do not understand how to use Request and RequestBuilder).
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.http.protocol.HttpProtocolBuilder
import org.asynchttpclient.{Request, RequestBuilderBase, SignatureCalculator}
class OpenSomethingSignatureCalculator extends SignatureCalculator {
// Default Headers
val defaultHeaders = Map("Content-Type" -> "application/json", "Authorization" -> "Basic")
// Http Client Config
val httpConf: HttpProtocolBuilder = http
.baseURL("https://mywebsite.bz") // Here is the root for all relative URLs
.headers(defaultHeaders)
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") // Here are the common headers
.acceptEncodingHeader("gzip, deflate")
.acceptLanguageHeader("en-US,en;q=0.5")
.userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0")
override def calculateAndAddSignature(request: Request, requestBuilder: RequestBuilderBase[_]): Unit = {
}
}