Urgent.News

What's breaking now, across hundreds of outlets.

Tech

See the HTTP requests your script makes, without changing it

My morning brief script found only 2 stories on my topics yesterday. The day before, it found 4. Was the API's answer different, or is my filter wrong? How do you find out? You add print(resp.read()) to the script, run it, and get one 200 KB line of JSON in your terminal. You also want the headers, so you add more prints. If the script used curl , you'd add -v and read TLS handshake lines. Either…

To understand what a script does without altering it, you can use a tool called cmdbook. By enabling capture for the command in its settings, cmdbook operates quietly in the background. It establishes a proxy that the script interacts with while pointing at the proxy, all while handling the necessary configuration for HTTPS, such as certificates.

This process allows you to observe each request the script makes, including its method, URL, and status code. For the example given, the script performed a GET request to a specific URL and received a 200 OK response. By examining the detailed breakdown provided by cmdbook, you can discern that only a small portion of the articles on the front page matched the script's specified topics.

This investigation reveals that the filter was properly configured; the lack of matches was due to the script being run during a period of low activity for those topics. Cmdbook supports a wide range of command-line tools, such as curl, wget, Python libraries like urllib, requests, and httpx, as well as most standard command-line utilities.

However, it does not intercept requests handled without proxy variables, such as Node's built-in fetch. It is worth noting that cmdbook's HTTP Capture feature is part of the Pro subscription, which enables users to explore and analyze their scripts' interactions with web services without the need to modify the scripts themselves or introduce additional tools.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

One sandbox per run, per session or per user: isolation, cost and state trade-offs

When you put an agent's code execution in a sandbox, you also decide, often without noticing, how many pieces of work share each sandbox. One per tool call? One per conversation?

  • Per run provides strongest isolation, but incurs repeated setup costs
  • Per session keeps isolation between users, but allows state leakage between turns
  • Per user grants long-lived environment, but risks drift and secret accumulation

How to Prepare for Campus Placements in 90 Days (2026 Plan for Freshers)

Most students start placement preparation too late and too wide — a bit of everything, nothing finished. Ninety days is enough to be test-ready and interview-ready for mass recruiters like TCS…

  • Begin preparation with aptitude, reasoning, and verbal skills in first three weeks
  • Cover core subjects and project in weeks 7-10, practice explaining project in one page
  • Refine resume, take timed company mocks, and prepare for interviews in weeks 11-13

Why does your Galaxy's Bluetooth keep disconnecting after a firmware update, and how do you fix it?

Why does your Galaxy's Bluetooth keep disconnecting after a firmware update, and how do you fix it? You install a firmware update, and suddenly your earbuds keep dropping, your car stereo will not…

  • Bluetooth disconnections may occur after firmware updates on Galaxy devices.
  • Issue could be due to damaged stored pairing information or power management changes.
  • Remove and re-pair device, restart phone, and adjust Bluetooth power settings to fix.

Propose only the fixes, without rewriting someone else's note

A teammate shared a procedure note, and there are two numbers in it you want to fix. If you send back the whole fixed version, they have to compare the two to find what changed, then copy it into…

  • System implemented for copying, modifying, and returning notes
  • Automatic backup of original note for version control
  • Sharing functionality limited to desktop application

More from Thursday 26 November →