What is “406-Not Acceptable Response” in HTTP?

后端 未结 9 1752
礼貌的吻别
礼貌的吻别 2020-11-22 08:20

In my Ruby on Rails application I tried to upload an image through the POSTMAN REST client in Base64 format. When I POST the image I am getting a 406 Not Acceptable Resp

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 08:51

    If you are using 'request.js' you might use the following:

    var options = {
      url: 'localhost',
      method: 'GET',
      headers:{
        Accept: '*/*'
      }
    }
    
    request(options, function (error, response, body) {
      ...
    })
    

提交回复
热议问题