tomas / needle

Nimble, streamable HTTP client for Node.js. With proxy, iconv, cookie, deflate & multipart support.
https://www.npmjs.com/package/needle
MIT License
1.63k stars 236 forks source link

Simple request URI modification logic #309

Closed awiejacha closed 4 years ago

awiejacha commented 4 years ago

Hello!

This small code gives opportunity to 'intercept' and modify request URI on-the-fly. When application is used to crawl/visit over resources, making request in the automated way, in some cases it is needed to modify uri/querystring, basing on some rules - e.g. we know that for specific location additional querystring or chunk of path needs to be appended/removed.