vlucas / frisby

Frisby is a REST API testing framework built on Jest that makes testing API endpoints easy, fast, and fun.
http://frisbyjs.com
1.53k stars 201 forks source link

PUT Call Double Encoding URL #581

Closed Cenric closed 2 years ago

Cenric commented 2 years ago

How do I stop my PUT call from double encoding my URL? I am retrieving a URL with a bunch of %2F's in it, and when I call my PUT with that URl being passed as a parameter, the request is using the URL with a bunch of %252F's in it instead which is messing everything up.

Cenric commented 2 years ago

I am currently trying

return frisby
      .fetch(url, {
          method: 'PUT',
          urlEncode: false,
          body: JSON.stringify({
              "somerandom": "json",
              "text": "here"
          })
      })

but am still getting the same error, and in the inspectRequest it is still sending the URL with %252F's

H1Gdev commented 2 years ago

FYI

https://github.com/vlucas/frisby/issues/552#issuecomment-588484776

return frisby
      .fetch(url, {
          method: 'PUT',
          body: JSON.stringify({
              "somerandom": "json",
              "text": "here"
          })
      }, {
          urlEncode: false,
      })
Cenric commented 2 years ago

Works perfectly, thank you