https://cypress.io logo
Upon using failOnStatusCode: false, in cy.request...
# general-chat
i
Upon using failOnStatusCode: false, in cy.request I can see some strange behaviour though i sent Content-Type as application/json I can see in response its showing request Header is not correct can you suggest from your end if there is any thing which i can correct it I also changed const CoreHeader = { "apikey": "apikey", 'Content-Type': 'application/json' } please find the response upon using failOnStatusCode as follows which also includes request sent. { "body": { "type": "https://tools.ietf.org/html/rfc7231#section-6.5.13", "title": "Unsupported Media Type", "status": 415, "traceId": "00-ec747d22a6d1d639b16f1b922d62cc0d-8df31bbae40ca9c9-00" }, "headers": { "content-type": "application/problem+json; charset=utf-8" "transfer-encoding": "chunked", "request-context": "appId=cid-v1:0a62bd16-0df1-4c83-866b-e8b12e7d08d3" }, "status": 415, "statusText": "Unsupported Media Type", "isOkStatusCode": false, "requestHeaders": { "Connection": "keep-alive", "apikey": "qull", "Content-Type": "application/x-www-form-urlencoded", ----- }, "requestBody": "0%5Bid%5D=5&0%5Bname%5D=ASC%204&0%5Btype%5D=3", "duration": 264, "allRequestResponses": [ { "Request Body": "0%5Bid%5D=5&0%5Bname%5D=ASC%204&0%5Btype%5D=3", "Request Headers": { "Connection": "keep-alive", "apikey": "qc_full", "Content-Type": "application/x-www-form-urlencoded", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36", }, "Request URL": "https:abcd.com/api/Students/Delete", "Response Body": "{\"type\":\"https://tools.ietf.org/html/rfc7231#section-6.5.13\",\"title\":\"Unsupported Media Type\",\"status\":415,\"traceId\":\"00-ec747d22a6d1d639b16f1b922d62cc0d-8df31bbae40ca9c9-00\"}", "Response Headers": {.....}, "Response Status": 415 } ] }