When the HAR file is converted to K6 JS and run, the response is HTTP 415.
{
"startedDateTime": "2023-04-28T18:56:21.054Z",
"time": 237.21100005786866,
"timings": {
"blocked": 138.46699999260903,
"dns": -1,
"ssl": -1,
"connect": -1,
"send": 0.07799999999999999,
"wait": 95.88000003886968,
"receive": 2.7860000263899565
},
"request": {
"method": "POST",
"url": "http://127.0.0.1:9080/smc-web/getCaseCategorySearchPrefOption.do",
"httpVersion": "http/1.1",
"headers": [
{
"name": "Accept",
"value": "text/html, */*; q=0.01"
},
{
"name": "Accept-Encoding",
"value": "gzip, deflate, br"
},
{
"name": "Accept-Language",
"value": "en-US,en;q=0.9"
},
{
"name": "Cache-Control",
"value": "no-cache"
},
{
"name": "Content-Length",
"value": "58"
},
{
"name": "Content-Type",
"value": "application/json; charset=UTF-8"
},
{
"name": "Cookie",
"value": "JSESSIONID=44B0A5B8A4A18DD157B12BCF3EAF26C4; crowd.token_key=T6rMIuipjGwpg6Oqsv42lAAAAAAAAIACc21jeXBkZXY"
},
{
"name": "Host",
"value": "127.0.0.1:9080"
},
{
"name": "Origin",
"value": "http://127.0.0.1:9080"
},
{
"name": "Pragma",
"value": "no-cache"
},
{
"name": "Proxy-Connection",
"value": "keep-alive"
},
{
"name": "Referer",
"value": "http://127.0.0.1:9080/smc-web/"
},
{
"name": "Sec-Fetch-Dest",
"value": "empty"
},
{
"name": "Sec-Fetch-Mode",
"value": "cors"
},
{
"name": "Sec-Fetch-Site",
"value": "same-origin"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.58"
},
{
"name": "X-Cypress-Is-XHR-Or-Fetch",
"value": "xhr"
},
{
"name": "X-Requested-With",
"value": "XMLHttpRequest"
},
{
"name": "sec-ch-ua",
"value": "\"Chromium\";v=\"112\", \"Microsoft Edge\";v=\"112\", \"Not:A-Brand\";v=\"99\""
},
{
"name": "sec-ch-ua-mobile",
"value": "?0"
},
{
"name": "sec-ch-ua-platform",
"value": "\"Windows\""
}
],
"queryString": [],
"cookies": [
{
"name": "jSESSIONID",
"value": "44B0A5B8A4A18DD157B12BCF3EAF26C4",
"httpOnly": false,
"secure": false
},
{
"name": "crowd.token_key",
"value": "T6rMIuipjGwpg6Oqsv42lAAAAAAAAIACc21jeXBkZXY",
"httpOnly": false,
"secure": false
}
],
"headersSize": 0,
"bodySize": 58,
"postData": {
"mimeType": "application/json; charset=UTF-8",
"text": "{\"globalDataSource\":\"\",\"cupsId\":\"caseCategory.searchPref\"}",
"params": []
}
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "Content-Encoding",
"value": "gzip"
},
{
"name": "Keep-Alive",
"value": "timeout=5"
},
{
"name": "Transfer-Encoding",
"value": "chunked"
},
{
"name": "Vary",
"value": "Accept-Encoding"
},
{
"name": "access-control-allow-origin",
"value": "*"
},
{
"name": "cache-control",
"value": "no-cache, no-store"
},
{
"name": "content-disposition",
"value": "inline;filename=f.txt"
},
{
"name": "content-type",
"value": "application/json;charset=UTF-8"
},
{
"name": "date",
"value": "Fri, 28 Apr 2023 18:56:20 GMT"
},
{
"name": "expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"name": "pragma",
"value": "no-cache"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
}
],
"cookies": [],
"content": {
"size": 23,
"mimeType": "application/json",
"compression": -36
},
"redirectURL": "",
"headersSize": 459,
"bodySize": 59,
"_transferSize": 518
},
"cache": {},
"serverIPAddress": "127.0.0.1",
"_priority": "VeryHigh",
"_resourceType": "XHR",
"_webSocketMessages": [],
"_eventSourceMessages": [],
"connection": "329"
},
response = http.post(
'http://127.0.0.1:9080/smc-web/getCaseCategorySearchPrefOption.do',
'{"globalDataSource":"","cupsId":"caseCategory.searchPref"}',
{
headers: {
Accept: 'text/html, */*; q=0.01',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9',
'Cache-Control': 'no-cache',
'Content-Type': 'application/json; charset=UTF-8',
Cookie:
'JSESSIONID=44B0A5B8A4A18DD157B12BCF3EAF26C4; crowd.token_key=T6rMIuipjGwpg6Oqsv42lAAAAAAAAIACc21jeXBkZXY',
Host: '127.0.0.1:9080',
Origin: 'http://127.0.0.1:9080',
Pragma: 'no-cache',
'Proxy-Connection': 'keep-alive',
Referer: 'http://127.0.0.1:9080/smc-web/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.58',
'X-Cypress-Is-XHR-Or-Fetch': 'xhr',
'X-Requested-With': 'XMLHttpRequest',
'sec-ch-ua': '"Chromium";v="112", "Microsoft Edge";v="112", "Not:A-Brand";v="99"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
},
}
)
{
"remote_ip": "127.0.0.1",
"remote_port": 9080,
"url": "http://127.0.0.1:9080/smc-web/getCaseCategorySearchPrefOption.do",
"status": 415,
"status_text": "415 ",
"proto": "HTTP/1.1",
"headers": {
"Content-Type": "text/html;charset=utf-8",
"Content-Language": "en",
"Pragma": "no-cache",
"X-Content-Type-Options": "nosniff",
"Access-Control-Allow-Origin": "*",
"Date": "Mon, 01 May 2023 16:32:26 GMT",
"Cache-Control": "no-cache, no-store",
"X-Xss-Protection": "1; mode=block",
"Content-Length": "1087",
"Expires": "Thu, 01 Jan 1970 00:00:00 GMT",
"X-Frame-Options": "DENY"
},
"cookies": {},
"body": "<!doctype html><html lang=\"en\"><head><title>HTTP Status 415 โ Unsupported Media Type</title><style type=\"text/css\">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 415 โ Unsupported Media Type</h1><hr class=\"line\" /><p><b>Type</b> Status Report</p><p><b>Description</b> The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.</p><hr class=\"line\" /><h3>Apache Tomcat/9.0.12</h3></body></html>",
"timings": {
"duration": 15.0709,
"blocked": 0,
"looking_up": 0,
"connecting": 0,
"tls_handshaking": 0,
"sending": 0,
"waiting": 15.0709,
"receiving": 0
},
"tls_version": "",
"tls_cipher_suite": "",
"ocsp": {
"produced_at": 0,
"this_update": 0,
"next_update": 0,
"revoked_at": 0,
"revocation_reason": "",
"status": ""
},
"error": "",
"error_code": 1415,
"request": {
"method": "POST",
"url": "http://127.0.0.1:9080/smc-web/getCaseCategorySearchPrefOption.do",
"headers": {
"User-Agent": [
"k6/0.44.0 (https://k6.io/)"
],
"Cookie": [
"JSESSIONID=E1D4533BA6077DA4A8848CCE7206E688; crowd.token_key=ZRGfyAJLLiQGadn50rOc0gAAAAAAAIACc21jeXBkZXY"
]
},
"body": "{globalDataSource:\"\",cupsId:\"caseCategory.searchPref\"}",
"cookies": {
"crowd.token_key": [
{
"name": "crowd.token_key",
"value": "ZRGfyAJLLiQGadn50rOc0gAAAAAAAIACc21jeXBkZXY",
"replace": false
}
],
"JSESSIONID": [
{
"name": "JSESSIONID",
"value": "E1D4533BA6077DA4A8848CCE7206E688",
"replace": false
}
]
}
}
}