Questions tagged [requesthandler]

104 questions
19
votes
6 answers

BaseHTTPRequestHandler with custom instance

this is my http server: from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer class test: def show(self): return "aaaa" class http_server: def __init__(self, t1): self.t1 = t1 server = HTTPServer(('', 8080),…
8
votes
1 answer

How can I setup a global DeadlineExceededError handler?

I'd like to catch and handle DeadlineExceededError so users don't see the standard "Server Error" page that App Engine throws by default. I know that DeadlineExceededErrors are not caught when overriding handle_exception in your request handler (we…
kamens
  • 11,910
  • 6
  • 45
  • 46
8
votes
3 answers

Tornado Asynchronous Handler

I am attempting to implement get_current_user in the RequestHandler for Tornado, but I need the call to block while waiting on the asynchronous call to my database. Decorating the call with @tornado.web.asynchronous will not work because either way…
Jarrod
  • 81
  • 1
  • 3
5
votes
4 answers

Solr Custom RequestHandler - injecting query parameters

Short question: I'm looking for a way (java) to intercept a query to Solr and inject a few extra filtering parameters provided by my business logic. What structures should I use? Context: First of all, a little confession: I'm such a rookie…
12N
  • 91
  • 1
  • 7
5
votes
2 answers

What is the best REST implemenation when using tornado RequestHandlers

I would like to define a REST API with a general pattern of: mysite.com/OBJECT_ID/associations For example: mysite.com/USER_ID/vacations - manage a users vacation mysite.com/USER_ID/music - manage music in the user's music…
4
votes
3 answers

Pass Parameter to SimpleHTTPRequestHandler

I have to pass a parameter to SimpleHTTPRequestHandler class, so I used class factory to create a custom handler as below. def RequestHandlerClass(application_path): class CustomHandler(SimpleHTTPRequestHandler): def __init__(self,…
3
votes
2 answers

Classic ASP: run some code at the start of every request before processing actual .asp file

This is classic ASP, running on IIS 8.5. I need to run some VBScript that should be common to all my *.asp pages at the beginning of every Http request to those *.asp files. Currently I am using a #include tag at the top of each and every *.asp…
3
votes
3 answers

Solr DataImportHandler configuration

I want to get data from mysql database with the help of DataImportHandler so i can create indexes. Now I've configured my Solr instance so that it works on Tomcat (the example admin page), but if I try to change the sorlconfig.xml file i'll get the…
talo
  • 33
  • 1
  • 3
2
votes
1 answer

How to create a RESTful Handler that accepts both POST and GET?

I want API support for: GET /api/spam/{id} POST /api/spam body: {'name': 'green spam'} I would normally route to a Handler by: webapp.WSGIApplication([r'/api/spam/(.*)', APISpam]) class APISpam(RequestHandler): def get(self, id): # do…
Will Curran
  • 6,959
  • 15
  • 59
  • 92
2
votes
0 answers

await function in Python

So this is some code i have in my python file, the details of the code aren't that important, I basically use this MainHandler to deal with some requests sent to it by a connection "client". class MainHandler(tornado.web.RequestHandler): #some…
am.torrinha
  • 59
  • 1
  • 8
2
votes
4 answers

Is using regex for a request handler in PHP bad?

I am working on a request handler to route every page call through my index page and have SEO friendly urls. domain.com/account/settings this would be easy to map to the correct page but some are more complex when there becomes an ID number or a…
JasonDavis
  • 48,204
  • 100
  • 318
  • 537
2
votes
1 answer

Override JSON view in RequestHandler in CakePHP

I want to rewrite JSON View in the RequestHandler. So there's a file project_root/lib/JsonView.php. What I want to do is to Import the JsonView.php file in another file in project_root/app/View/CustomJsonView.php. (I think I could use App:import,…
handkock
  • 1,067
  • 2
  • 11
  • 23
2
votes
0 answers

Log REST request using org.apache.wink RequestHandler

I have a requirement to log the REST request and response messages, so I have used apache wing RequestHandler. And I am able to get the response using the ResponseHandler. But unable to get the Request details in Handler Class. Could you please help…
kattoor
  • 195
  • 14
2
votes
1 answer

Solr MailEntityProcessor DIH configuration keeps loading

I am trying to index my emails from Microsoft Exchange. The server is using IMAP4 protocols. I added the requestHandler in solrconfig.xml:
Cumatru Cosu
  • 103
  • 2
  • 7
2
votes
1 answer

Wro4j enable/disable cache dyanamically

I would like to configure Wro4j in such a way that it should dynamically enable/disable cache based on the properties file (not wro.properties) is implementing a custom RequestHandeler good ideal? Please let me know if there is any possible way to…
sun2
  • 1,118
  • 1
  • 13
  • 17
1
2 3 4 5 6 7