Hi
When I try to fetch text from csv file to be entered in a text field, I get following error & the request is getting failed.
Contents of csv file:
You should probably using a Body instead of a form param.
.body(StrinBody("""{“name”:"${name}"}"""))
Thanx. It worked for me.
But now I am not able to understand which parameters are being fetched.
Like previously it used to show :
params=
{“name”:“test_amar1”}: []
Because you were not really posting a regular form in the first place, you were actually posting a JSON payload.
Request bodies can be huge and binaries instead of test, so we don’t log them.
Hi
.body(StringBody("""{“name”:"${name}",“type”:"${movie}"}""", “”""""))
While passing two parameters from csv file, it is giving me following error:
too many arguments
Why did you add a second parameter to StringBody???
.body(StringBody("""{“name”:"${name}",“type”:"${movie}"}""", “”""""))
Ohh sorry…
Actually original simulation had :
.param("""{“name”:“amar_testplaylist1”,“type”:“movie”}""", “”""""))
So I didn’t notice while replacing it with code you suggested.
Thanks.
It is still giving me attribute not defined error:
.feed(csv(“playlist.csv”).circular)
.exec(http(“request_110”)
.post(""“https://api-staging.ooyala.com/v2/playlists”"")
.headers(headers_37)
.body(StringBody("""{“name”:"${name}",“type”:"${movie}"}""")))
14:31:39.430 [ERROR] i.g.h.a.HttpRequestAction - No attribute named ‘name’ is defined
playlist.csv (813 Bytes)
Your file is not a CSV one. CSV means comma separated values.
Your file uses 2 tabs which is just WTF.
Either use 1 single comma and csv(), or use 1 single tab and tsv().
Thanks a ton.
Finally got the way to write csv file. Got my misconceptions corrected.