vlucas/frisby

PUT Call Double Encoding URL

Cenric opened this issue · 3 comments

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.

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

FYI

#552 (comment)

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

Works perfectly, thank you