http-error

UrlFetch getting 404 error from spreadsheet URL

纵饮孤独 提交于 2019-11-28 14:09:46
I am consistently getting a 404 - Requested entity not found response when I use UrlFetchApp to export a spreadsheet as a PDF. If I put the same URL into a browser, the PDF download initiates properly. What can I do to get this example script to work? Here's an example PDF export URL, for a simple shared (read-only) spreadsheet: https://docs.google.com/spreadsheets/d/133KPZyxAATG3AAY9iCSFWabefyFvQnENkHh0dyqh7MI/export?exportFormat=pdf&format=pdf&gid=0&size=letter&portrait=true&fitw=true&sheetnames=false&printtitle=false&pagenumbers=false&gridlines=false&fzr=false If you click on that URL in

Overriding urllib2.HTTPError or urllib.error.HTTPError and reading response HTML anyway

岁酱吖の 提交于 2019-11-28 03:38:25
I receive a 'HTTP Error 500: Internal Server Error' response, but I still want to read the data inside the error HTML. With Python 2.6, I normally fetch a page using: import urllib2 url = "http://google.com" data = urllib2.urlopen(url) data = data.read() When attempting to use this on the failing URL, I get the exception urllib2.HTTPError : urllib2.HTTPError: HTTP Error 500: Internal Server Error How can I fetch such error pages (with or without urllib2 ), all while they are returning Internal Server Errors? Note that with Python 3, the corresponding exception is urllib.error.HTTPError . Joe

Need response body of HTTP 500 with file_get_contents (PHP)

血红的双手。 提交于 2019-11-28 00:38:59
Using file_get_contents as part of custom SOAP implementation to apply SOAP calls (ALL libraries that we tried would not do SSL + certificate based authentication with SOAP 1.2 correctly). However difficult and barely-documented API often returns 500. There are error details in response body, but file_get_contents doesn't appear to allow access to it. fopen seems to have the same issue. What do? Prefer not to go to cURL due to heavy use of stream contexts to get authentication working. You might consider nusoap . For your question though, it works if you use ignore_errors . $context = stream

Setting errorPage in Umbraco

北城余情 提交于 2019-11-27 23:03:43
问题 I am developing a web application using Umbraco. I create a content called PageNotFound and, in the errors section of umbracoSettings.config file, I put the node id of that for 404 error404. The problem is that, with IIS 7, IIS always looks for the HttpErrors section in web.config and does not pay attention to umbracoSettings.config. What should I do? 回答1: In your web.config (system.webServer section) you can tell the site to pass all of the error handling through to the application:

How do I display custom error pages in Asp.Net Mvc 3?

三世轮回 提交于 2019-11-27 17:15:46
I want all 401 errors to be be redirected to a custom error page. I have initially setup the following entry in my web.config. <customErrors defaultRedirect="ErrorPage.aspx" mode="On"> <error statusCode="401" redirect="~/Views/Shared/AccessDenied.aspx" /> </customErrors> When using IIS Express I receive the stock IIS Express 401 error page. In the event when I do not use IIS Express a blank page is returned. Using Google Chrome's Network tab to inspect the response, I see that while the page is blank a 401 status is returned in the headers What I have tried thus far is using suggestions from

HTTPError: HTTP Error 503: Service Unavailable goslate language detection request : Python

风格不统一 提交于 2019-11-27 14:41:53
I have just started using the goslate library in Python to detect the language of the words in a text but after testing it for 7-8 inputs, I gave the input which had the words written in two languages, Arabic and English. After which, it started giving me the error. Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> execfile("C:/test_goslate.py"); File "C:/test_goslate.py", line 12, in <module> language_id = gs.detect('الدولة') File "C:\Python27\lib\site-packages\goslate.py", line 484, in detect return self._detect_language(text) File "C:\Python27\lib\site

urllib2 HTTP Error 400: Bad Request

旧街凉风 提交于 2019-11-27 07:51:45
I have a piece of code like this host = 'http://www.bing.com/search?q=%s&go=&qs=n&sk=&sc=8-13&first=%s' % (query, page) req = urllib2.Request(host) req.add_header('User-Agent', User_Agent) response = urllib2.urlopen(req) and when I input a query greater than one word like "the dog" i get the following error. response = urllib2.urlopen(req) 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 400, in open response = meth(req, response) File "/usr/lib/python2.7/urllib2.py", line 513, in http_response 'http',

Overriding urllib2.HTTPError or urllib.error.HTTPError and reading response HTML anyway

余生长醉 提交于 2019-11-27 00:11:44
问题 I receive a 'HTTP Error 500: Internal Server Error' response, but I still want to read the data inside the error HTML. With Python 2.6, I normally fetch a page using: import urllib2 url = "http://google.com" data = urllib2.urlopen(url) data = data.read() When attempting to use this on the failing URL, I get the exception urllib2.HTTPError : urllib2.HTTPError: HTTP Error 500: Internal Server Error How can I fetch such error pages (with or without urllib2 ), all while they are returning

Need response body of HTTP 500 with file_get_contents (PHP)

我与影子孤独终老i 提交于 2019-11-26 21:45:50
问题 Using file_get_contents as part of custom SOAP implementation to apply SOAP calls (ALL libraries that we tried would not do SSL + certificate based authentication with SOAP 1.2 correctly). However difficult and barely-documented API often returns 500. There are error details in response body, but file_get_contents doesn't appear to allow access to it. fopen seems to have the same issue. What do? Prefer not to go to cURL due to heavy use of stream contexts to get authentication working. 回答1:

How to enable ASP classic in IIS7.5

孤街醉人 提交于 2019-11-26 20:55:39
I am running IIS 7.5 in Windows 7 and have already gone into "Turn Windows features on or off" and enabled ASP in "Internet Information Services/World Wide Web Service/application Development Features". Once I did that I started getting an HTTP 404 error saying: The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. So I took this to mean that I needed to add a mapping to *.asp in the Handler mappings and the handler is mapped to C:\Windows\System32\inetsrv\asp.dll. But when