http-error

Python: urllib2.HTTPError: HTTP Error 300: Multiple Choices

倾然丶 夕夏残阳落幕 提交于 2020-01-06 13:14:19
问题 I have a script that is looking for informations in web text pages and then store them in a dictionary. The script is looking for URL in a list and then process them all in a loop, however it get interrupted in the middle of the process by this error: Traceback (most recent call last): File "<stdin>", line 3, in <module> File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/usr/lib/python2.7/urllib2.py", line 406, in open response = meth(req

Angular 5 (Karma / Jasmine Testing) - Using a mock backend to mock error responses for error messages

*爱你&永不变心* 提交于 2020-01-06 09:04:09
问题 I don't quite understand how the MockBackend feature works as described over here. I am completely new to Angular. I want to program some test cases to make sure that when a server error occurs in the backend, the Angular components I have do display error messages on the frontend. That requires having HTTP requests that return errors on purpose. I am running into trouble with the jasmine-ajax and the nock packages, but someone told me about programming an instance Even if you have an actual

Error in UseMethod(“http_error”) in roadoi

为君一笑 提交于 2020-01-04 01:38:07
问题 I'm trying out roadoi to access Unpaywall from R, but no matter what I try to query for, I'm getting this response: Error in UseMethod("http_error") : no applicable method for 'http_error' applied to an object of class "c('simpleError', 'error', 'condition')" Running methods(http_error) gives me this: [1] http_error.character* http_error.integer* http_error.response* Could this be caused by me being behind an institutional firewall? (even so, it seems weird that this would be the response...)

Response with 422 status code from nginx lacks 'Access-Control-Allow-Origin' header

邮差的信 提交于 2019-12-31 03:53:05
问题 nginx config as follows: server { listen 80; listen [::]:80; add_header 'Access-Control-Allow-Origin' $http_origin; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT, PATCH'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; add_header 'Access-Control-Max-Age' 1728000; server_name erp.dev.thinkerx.com; access_log /home/thinkerx/nginx/access.log; error

Rest error message in HTTP Header or Response Body?

試著忘記壹切 提交于 2019-12-29 13:38:04
问题 I have a REST service that is exposed to iPhone and Android clients. Currently I follow the HTTP codes 200, 400, 401, 403, 404, 409, 500 etc. My question is where is the recommended place to put the reason/description/cause of the error? Does it make more sense for the REST API to always have custom Reason in the header like so? < HTTP/1.1 400 Bad Request - Missing Required Parameters. < Date: Thu, 20 Dec 2012 01:09:06 GMT < Server: Apache/2.2.22 (Ubuntu) < Connection: close < Transfer

httpClient -> HTTP/1.1 500 Internal Server Error

本小妞迷上赌 提交于 2019-12-25 01:55:47
问题 I'm allways getting this error ( HTTP/1.1 500 Internal Server Error ) when I'm trying to do a PUT/POST in my REST client application, using HttpClient. Do you have any idea of what kind of error it can be? Isn't it a error in the code? It tells that is in teh Server.. If you need some of my code, just ask for it! Thanks This is the message I receive in the server logs: [#|2013-03-15T09:34:32.508+0000|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID

ASP.Net request raises 502 Bad Gateway or TimeOut

北慕城南 提交于 2019-12-24 13:24:37
问题 I have a C# ASP.NET Webforms website running on IIS7. It is a report creation application that queries the SQL Server database, gets the data, parses it in to an Excel document. The query itself doesn't take too long, but writing to the Excel takes a while when the query is very large (50,000 rows). Now for the problem, when I run the report app, I get the report with in a few minutes but when some users run it, the report returns 502 Bad Gateway. This only happens for large reports. I assume

Android - Webviewclient onReceivedHttpError determine if is main resource

被刻印的时光 ゝ 提交于 2019-12-24 09:58:45
问题 WebViewClient.onReceivedError was deprecated, now I have to use onReceivedHttpError to handle the webview errors, however this method receives the error from any resource, which is not what I desire. I wish only to detect the main URL failing . How should I detect the error if I am using API 10 ? I tried using the request.getUrl() method but it is only compatible with API 23. 回答1: Meanwhile, I ended up doing this: @Override public void onReceivedError(WebView view, int errorCode, String

ASP.net “{Controller}/” returning 403.14 error

感情迁移 提交于 2019-12-24 08:29:47
问题 I am having a curious issue with one of my projects in development. The issue is with links to a certain URL "//localhost:62168/Images/Index". I have buttons linking to that URL but when "//localhost:62168/Images/" is accessed it returns a HTTP Error 403.14 - Forbidden error. See the below Image: localhost//Images/ Oddly enough though, when I enter the URL exactly ("localhost:62168/Images/Index") it loads the page properly. See the below Image: localhost/Images/Index I've done plenty of

Unsupported Media Type with HttpClient / .NET Core

半世苍凉 提交于 2019-12-23 22:22:54
问题 I am working with a RESTful API that supports POST requests in JSON format. The API's own Swagger documentation shows that this is a valid call to one of its endpoints: curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '<JSON>' '<URL>' Where <JSON> and <URL> are the valid JSON message and the endpoint's URL. From this Swagger documentation I gather that any posts to this endpoint must include both a Content-Type and Accept headers set to application