i my case i need to print response strings or anything as a response into a text file,what i need to do?

Hi Stephane,

i can successfully send the request through POST with some parameters, i am able to see this in console also as OK=1
i am trying to print the response strings or JSON strings into a text file,but i am unable to print into text file,

if possible i want to print the response on the console also,

please help me on this with detailed example,

any help is greatly appreciated.

http://logback.qos.ch/manual/appenders.html#FileAppender

i am able to print response status,content-type and content length on the console and in log file also bu t i am unable to print my response body into a file or console…

in my case my response as JSON string and i want to print that JSON string into a file or onto console… and my scenario is like

class RecordedSimulation extends Simulation {

val httpProtocol = http
.baseURL(“my base URL”)
.disableFollowRedirect
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”)
.doNotTrackHeader(“1”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0”)
.connection(“keep-alive”)

val header = Map(“Content-Type” → “application/x-www-form-urlencoded”)
val scn = scenario(“scenario”)

.exec(http(“GET web service”)

.post(“REST service path that which is appended to base url”)

.headers(header)
.param(“userId”, “user”)
.param(“tid”, “1”)
.param(“pageId”, “89”)
.param(“search”,“JSON string”)
.param(“version”, “1”)
.param(“requestType”, “SOME_LIST”)
.param(“Plane”, “HIALLDP_REGALLALL”)
)
setUp(scn.inject(atOnce(1 user))).protocols(httpProtocol)
}

i will successfully run this scenario and i am able to print the output in console as well as in log file as you said but it is printing only type of response not response body.

i was done changes in logback.xml like uncommenting for logging ALL HTTP request and responses and adding appender for log file…

can you please suggest me on this…how to get respone JSON string on to console or to log file.

http://gatling.io/docs/2.0.0-RC5/http/http_protocol.html#response-chunks-discarding