-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
str.replace is not a function during cy.request() #2923
Comments
I am able to verify this seems like a bug. Reproducible example it('throws an error', function () {
cy.request({
'method': 'POST',
'url': 'https://jsonplaceholder.cypress.io/comments',
'headers': {
'Accept': 'application/json',
'content-type': 'application/x-www-form-urlencoded',
},
'body': {
'scope': 'my_scope',
},
})
}) |
This The root of the issue seems to be that the If you look at the docs for
|
The code for this is done in cypress-io/cypress#3440, but has yet to be released. |
Released in |
Current behavior:
Upon
cy.request
with a seemingly valid header, following is the stack trace of the error. Note that changing the header key "content-type" to "ContentType" makes the error go away.Desired behavior:
Network call made. I realize now that "form":true is the accepted method of setting that content type; still minor bug.
Create this options object:
Versions
3.1.3
The text was updated successfully, but these errors were encountered: