bad-request

ASP.NET MVC: How to handle 400 bad request error when url end with %

我的梦境 提交于 2019-12-19 21:45:08
问题 I am trying to handle all HTTP errors to my custom error pages, but I find that when there is a % at the end of url, i cannot use config setting or code to handle it, for example: http://localhost/abc% the response is: Bad Request - Invalid URL HTTP Error 400. The request URL is invalid. So, can we use config setting or c# code to handle this error request? 回答1: See this 4 part series for configuring custom error pages within IIS: http://www.dotnetscraps.com/dotnetscraps/post/Did-you-know

Guzzle: handle 400 bad request

谁都会走 提交于 2019-12-18 11:23:05
问题 I'm using Guzzle in Laravel 4 to return some data from another server, but I can't handle Error 400 bad request [status code] 400 [reason phrase] Bad Request using: $client->get('http://www.example.com/path/'.$path, [ 'allow_redirects' => true, 'timeout' => 2000 ]); how to solve it? thanks, 回答1: As written in Guzzle official documentation: http://guzzle.readthedocs.org/en/latest/quickstart.html A GuzzleHttp\Exception\ClientException is thrown for 400 level errors if the exceptions request

Google Calendar API - Bad Request (400) Trying To Swap Code For Access Token

萝らか妹 提交于 2019-12-18 09:45:14
问题 Having got an authorisation code from Google for accessing a user's calendar, I'm now trying to swap this for an access token. According to their own docs: The actual request might look like: POST /o/oauth2/token HTTP/1.1 Host: accounts.google.com Content-Type: application/x-www-form-urlencoded code=4/v6xr77ewYqhvHSyW6UJ1w7jKwAzu& client_id=8819981768.apps.googleusercontent.com& client_secret={client_secret}& redirect_uri=https://oauth2-login-demo.appspot.com/code& grant_type=authorization

Ruby on Rails HTTPS Post Bad Request

我们两清 提交于 2019-12-18 09:35:00
问题 Greetings all. My application works with a remote server. Server uses https authorization of the certificate. I have following code to authorize and sends request: uri = URI.parse("https://db1-test.content.ertelecom.ru/") http = Net::HTTP.new(uri.host, '443') http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_PEER http.ca_file = File.join(File.dirname("public/certificate.pem"), "certificate.pem") http.start do |http| req = Net::HTTP::Get.new("/cgi-bin/expr/export.get_pay_systems

Instagram oAuth returning “No matching code found” on one server

早过忘川 提交于 2019-12-18 05:47:17
问题 I'm currently receiving {"code": 400, "error_type": "OAuthException", "error_message": "No matching code found."} while attempting to get a user's access token on one of our servers. This is occurring while using the REST Client Chrome extension and from our web application, on one particular server. I am able to receive the user's access token from my local machine and a different server using the same code and extension. Could our IP have been blacklisted from receiving access tokens? Has

What is the cause of the Bad Request Error when submitting form in Flask application?

不想你离开。 提交于 2019-12-17 02:24:10
问题 After reading many similar sounding problems and the relevant Flask docs, I cannot seem to figure out what is generating the following error upon submitting a form: 400 Bad Request The browser (or proxy) sent a request that this server could not understand. While the form always displays properly, the bad request happens when I submit an HTML form that ties to either of these functions: @app.route('/app/business', methods=['GET', 'POST']) def apply_business(): if request.method == 'POST': new

Keep Getting Bad Request from HTTP.request in Node.js

情到浓时终转凉″ 提交于 2019-12-13 15:14:04
问题 I just installed Node.js and perhaps I'm missing something but I'm trying a simple http.request and get nothing but 400 responses. I've tried several hosts with no luck. I installed Node from their site, this didn't work, so I uninstalled and installed via Homebrew and get the same output of "400". I'm specifically wondering if there's something I need to change on my Mac to allow Node to send requests. OSX 10.8.4 Node 0.10.13 Homebrew 0.9.4 var http = require("http"); var req = http.request(

Add contact to pushbullet with the api

折月煮酒 提交于 2019-12-13 04:39:18
问题 I'm trying to add a contact to my contacts on pushbullet using the api. I send following json data with my POST request to https://api.pushbullet.com/v2/contacts { "name": "some name", "email": "test@example.com" } According to the documentation this should add the contact. Instead I get a bad request error. When requesting my list of contacts via the api, it is always empty. I can add contacts using the Windows desktop client and via the web. However those contacts only show up on the

Alfresco login api giving Bad Request 400

放肆的年华 提交于 2019-12-13 03:33:44
问题 I am trying to login to alfresco through api. I do not know why it is returning error 400 Bad Request. The json should be correct and in my ajax call I have also set the content type to 'application/json'. This is my ajax call. var jsonData = JSON.stringify({ username : usernameV, password : passwordV }); var request = $.ajax({ settings : {contentType:'application/json'}, type: "POST", url: "http://---ip---/alfresco/service/api/login", data: jsonData }); The json string in the console. {

Direct Upload to Cloudinary from Browser Bad Request

蹲街弑〆低调 提交于 2019-12-13 01:19:51
问题 i'm getting a 400 bad request error when trying to upload to cloudinary with the following code: $("input.cloudinary-fileupload[type=file]").cloudinary_fileupload(); $.cloudinary.config({"api_key":"6586856745648955","cloud_name":"some-cloud"}); $http.get("http://localhost:3000/story/secret") .then(function(res){ var CLOUD_API_SECRET = res.data.CLOUD_API_SECRET; var obj = { "timestamp": Date.now(), "callback": "http://localhost:3000/cloudinary_cors", "signature": CLOUD_API_SECRET, "api_key":