http-error

Recovering from HTTPError in Mechanize

你说的曾经没有我的故事 提交于 2019-12-03 06:38:53
I am writing a function for some existing python code that will be passed a Mechanize browser object as a parameter. I fill in some details in a form in the browser, and use response = browser.submit() to move the browser to a new page, and collect some information from it. Unfortunately, I occasionally get the following error: httperror_seek_wrapper: HTTP Error 500: Internal Server Error I've navigated to the page in my own browser, and sure enough, I occasionally see this error directly, so I think this is a server problem, not anything to do with robots.txt , headers or similar. The problem

Instagram/feed API media URL shows 'URL signature expired'

不羁岁月 提交于 2019-12-03 04:36:28
I am using Instagram feed API to show my Instagram posts on my Website. But some video URL shows ' URL signature expired '. Any solution for me ? Jordi Instagram has added URL signatures to their media URLs. You can easily remove the URL signature using this regular expression: "vp.*/.{32}/.{8}/" For example in PHP: preg_replace('/vp.*\/.{32}\/.{8}\//', '', $mediaUrl) On the other hand, I don't think that removing the URL signature is the best solution (is just a quick fix). The good one is to call again the Instagram api in order to get the new URL. UPDATE It seems that Instagram is currently

How do I set cookies using Python urlopen?

非 Y 不嫁゛ 提交于 2019-12-03 03:58:54
I am trying to fetch an html site using Python urlopen. I am getting this error: HTTPError: HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop The code: from urllib2 import Request request = Request(url) response = urlopen(request) I understand that the server redirects to another URL and that it is looking for a cookie. How do I set the cookie it is looking for so I can read the html? Here's an example from Python documentation , adjusted to your code: import cookielib, urllib2 cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2

Accessing HTTP Error Response Body from HttpInterceptor in Angular

≯℡__Kan透↙ 提交于 2019-12-03 03:32:01
I have an HttpInterceptor to catch errors and display them in a modal. Besides error code and message, I would also like to show the body of the response which actually holds a more precise description of the error (e.g. on a 500 internal server error). How can I achieve this in angular? (I am using version 4.3.6.) I already looked at related questions but answers like HttpErrorResponse._body or similar don't work for me. Also, when inspecting the error response in the console, HttpErrorResponse.error is set to null. Here is how my interceptor currently looks: @Injectable() export class

Understanding “408 Request Timeout” on Apache with PHP

女生的网名这么多〃 提交于 2019-12-03 02:06:29
Issue description - Apache logs I found items similar to this one in the Apache log file: 166.147.68.243 [24/Feb/2013:06:06:25 -0500] 19 web-site.com "-" 408 - "-" I’ve got custom log format and 408 here stands for status. The log format is: LogFormat "%h %t %D %V \"%r\" %>s %b \"%{User-agent}i\"" detailed And normally the line in the log file looks like 184.73.232.108 [26/Feb/2013:08:38:16 -0500] 30677 www.site.com "GET /api/search... HTTP/1.1" 200 205 "Zend_Http_Client" This is why 408 error lines look strange to me. No request is logged and I have no idea on what should be optimized.

500.19 error in IIS7 when an error occurs

帅比萌擦擦* 提交于 2019-12-03 01:43:01
Setup: Windows 7, IIS7. I am working on an app that is being viewed through the local IIS server, not the built in debugging web server. So my app url is http://localhost/foo/bar.aspx . There is no <customErrors> section in my web.config, and I haven't changed any settings in IIS. If any error occurs, I always get the following error screen: HTTP Error 500.19 - Internal Server Error Absolute physical path " C:\inetpub\custerr " is not allowed in system.webServer/httpErrors section in web.config file. Use relative path instead. Here's my applicationhost.config contents: <httpErrors errorMode=

Is the order of webrequest Headers important?

僤鯓⒐⒋嵵緔 提交于 2019-12-02 11:17:38
问题 I'm making a POST request to upload a picture to a website. In the page, there is one FileUpload and one input (textBox) and in fiddler I found out that the page is sending some data using Multipart Post request mode (Content Disposition: multipart-formdata;) Everything seems to be OK, coz in fiddler everything is the same about what my app is posting and what the page is sending... Just not about headers order... My question is that is it really important to put headers in a right order? and

intercepting upstream error with nginx

删除回忆录丶 提交于 2019-12-02 09:23:44
问题 My app runs with nginx and uwsgi (python). My aim is to drop a connection (as explained here) e.g. when the python app decides to do so. Is there a nginx parameter to "intercept" upstream errors similar to proxy_intercept_errors ? According to this answer, My nginx config: location / { uwsgi_pass myapp; include uwsgi_params; uwsgi_buffering on; uwsgi_buffer_size 8k; uwsgi_connect_timeout 800; uwsgi_read_timeout 800; uwsgi_send_timeout 800; proxy_intercept_errors on; error_page 420 =444 @foo;

Is the order of webrequest Headers important?

本秂侑毒 提交于 2019-12-02 08:22:46
I'm making a POST request to upload a picture to a website. In the page, there is one FileUpload and one input (textBox) and in fiddler I found out that the page is sending some data using Multipart Post request mode (Content Disposition: multipart-formdata;) Everything seems to be OK, coz in fiddler everything is the same about what my app is posting and what the page is sending... Just not about headers order... My question is that is it really important to put headers in a right order? and if yes, how can I do it? (as we are just setting some properties in request, there is no where to set

“http error” when using Uploadify plugin for JQuery

微笑、不失礼 提交于 2019-12-01 23:26:23
问题 I'm using the plugin from here: http://www.uploadify.com/ I have setup a simple test case, select a file etc & I get a "HTTP Error" when I try to upload. Here is the relevant code from my header.. <script type="text/javascript" src="../js/jquery.js"></script> <script type="text/javascript" src="../js/swfobject.js"></script> <script type="text/javascript" src="js/jquery.uploadify.v2.1.0.min.js"></script> <link href="css/reset.css" rel="stylesheet" type="text/css" /> <link href="css/admin.css"