-4

I am new with the tool jmeter, Can you help me script this request please? Thank you in advance for your assistance

curl -S -i -k -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer eyJtb2QiOiJhY2Nlc3MiLCJraWQiOiJTVD1JTEUgREUgRlJBTkNFLEw9UEFSSVMsQz1GUixDTj1XT0FfUFAsTz1MQ0wsT1U9RElHXC9ESUdcL0JQSSIsIng1YyI6WyJNSUlEWlRDQ0FrMmdBd0lCQWdJQ0kyQXdEUVlKS29aSWh2Y05BUUVMQlFBd2dhb3hDekFKQmdOVkJBWVRBa1pTTVJnd0ZnWURWUVFLRXc5RFVrVkVTVlFnVEZsUFRrNUJTVk14R2pBWUJnTlZCQU1URVVOQklGUkZVMVFnUkZOVVNTQXlNRFE0TVF3d0NnWURWUVFMRXdOQlNWTXhFekFSQmdOVkJBY1RDa3hCSUVSRlJrVk9VMFV4S2pBb0JnTlZCQWtUSVRnd0lFVlRVRXhCVGtGRVJTQkVWU0JIUlU1RlVrRk1JRVJGSUVkQlZVeE1SVEVXTUJRR0ExVUVDQk1OU1V4RklFUkZJRVpTUVU1RFJUQWVGdzB4T0RBM01UY3dPVFE0TXpOYUZ3MHhPVEEzTVRjd09UUTRNek5hTUdveEZqQVVCZ05WQkFnTURVbE1SU0JFUlNCR1VrRk9RMFV4RGpBTUJnTlZCQWNNQlZCQlVrbFRNUXN3Q1FZRFZRUUdFd0pHVWpFUE1BMEdBMVVFQXd3R1YwOUJYMUJRTVF3d0NnWURWUVFLREFOTVEwd3hGREFTQmdOVkJBc01DMFJKUnk5RVNVY3ZRbEJKTUlHZk1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTkFEQ0JpUUtCZ1FETVN4c2ZqXC9cL1JGckVudzUrQlE2SVlpcytkeGRWK1JPWWFmVnZuVmJ1ZTg2YmMyVDU4dGNCOXIxVVZ4NW91UkVXUGNaUU5Tak9rVUFJZjJiUFE5ekFIMWVFa3FmSWdJeTVBNU1lYkErNUgwSmxaZXRleXFhdCtDTDZWXC9iZ3pYSkF0dEwzRFNwVEFlVWpCeHhSdlBnb2NmVVlEMXpGNStrODBvVmY2a0hSSThRSURBUUFCbzFnd1ZqQWRCZ05WSFE0RUZnUVVmMkZvaUNYeXdrXC9TVXEwMnBUODZtSHZ5YVpzd0NRWURWUjBqQkFJd0FEQXFCZ05WSFJFRUl6QWhnUjlEUlZKVVNVWkpRMEZuec1yOJ1k"

https://my-domain/services

I started the test with http request, but I do not know how to integrate my token to make the call my service?

enter image description here

i have error :

Thread Name: Thread Group 1-1
Sample Start: 2018-08-14 14:39:59 CEST
Load time: 2998
Connect Time: 0
Latency: 0
Size in bytes: 1959
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 1959
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.UnknownHostException
Response message: Non HTTP response message: my-server

Response headers:

HTTPSampleResult fields:
ContentType: 
DataEncoding: null

closed as unclear what you're asking by trashpanda, Yu Zhang, Niels van Reijmersdal, Bharat Mane, Nitin Rastogi Aug 27 '18 at 11:19

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Do you understand what is happening when you execute this command? – Alexey R. Aug 14 '18 at 11:34
1
  1. Your get Unknown Host error because the value you are using in "Server Name or IP" cannot be resolved to an IP
  2. According to the CURL command you have provided in your question you should add headers to your request, however you are trying to add those values as the parameters.

So summing up, to resolve your issues, you need to:

  1. Specify proper host name
  2. Add Header Manager to your Thread Group
  3. Put headers (name and value for each header: Content-Type, Authorization) there so that your requests will be supplied with the required headers.
1

Just record it with JMeter's HTTP(S) Test Script Recorder

  1. Prepare JMeter for recording. The easiest way is using JMeter Templates feature.

    • From JMeter main menu choose File -> Template -> Recording and click Create
    • Click HTTP(S) Test Script Recorder and press Start button
  2. Amend your curl command to use JMeter as the proxy like:

    curl -x localhost:8888 -S -i -k -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer eyJtb2QiOiJhY2....
    
  • I register my request, it works very well but when I run for the second time it ends with errors. I see that jmeter added: HTTP Authorization Manager (rct.devinfo/services $ {AUTH_LOGIN} $ {AUTH_PASSWORD} KERBEROS HTTP Header Manager: Content-Type application / json User-Agent curl / 7.57.0 Accept application / json where is the pbm? – Alhamadani Aug 16 '18 at 14:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.