roundtrip

batch http requests

天涯浪子 提交于 2019-12-02 20:46:36
Does anyone know a standard way to batch http requests? Meaning - sending multiple http atomic requests in one round trip? We need such mechanism in our REST API implementation for performance reasons. This kind of mechanism can reduce dramatically the number of round trips that the client needs to perform to consume the API. Thanks in advance, Shay Define a new resource that contains the data the client wants. See http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven#comment-743 There's an official HTTP way to do that which is called HTTP Pipelining . But you may have more

Measuring the HTTP response time with requests library in Python. Am I doing it right?

痞子三分冷 提交于 2019-11-30 08:31:37
问题 I am trying to induce an artificial delay in the HTTP response from a web application (This is a technique used to do blind SQL Injections). If the below HTTP request is sent from a browser, response from the web server comes back after 3 seconds(caused by sleep(3)): http://192.168.2.15/sqli-labs/Less-9/?id=1'+and+if+(ascii(substr(database(),+1,+1))=115,sleep(3),null)+--+ I am trying to do the same in Python 2.7 using the requests library. The code I have is: import requests payload = {"id":

Nginx convert subdomain to path component without redirect

走远了吗. 提交于 2019-11-28 04:08:45
The idea is to take incoming requests to http://abc.example.com/... and rewrite them to http://example.com/abc/... That's easy enough to do with a 301/302 redirect: # rewrite via 301 Moved Permanently server { listen 80; server_name abc.example.com; rewrite ^ $scheme://example.com/abc$request_uri permanent; } The trick is to do this URL change transparently to the client when abc.example.com and example.com point at the same Nginx instance. Put differently, can Nginx serve the contents from example.com/abc/... when abc.example.com/... is requested and without another client round trip ?