今日已更新 428 条资讯 | 累计 22190 条内容
关于我们

标签:#rest

找到 7 篇相关文章

AI 资讯

Built by a Developer, for Developers: Why PSRESTful Is the Fastest Path to PromoStandards Integrations

PSRESTful wasn't designed in a product meeting. It was built by a developer who spent years wiring PromoStandards integrations by hand: crafting SOAP envelopes, hunting down the right namespace for each service version, and parsing megabytes of XML just to answer "how many blue mugs are in stock?" Every feature on the platform exists because that pain was real. This post walks through what "developer-first" actually means in practice: the choices in the API itself, the tools around it, and the open-source pieces you can read and reuse. All of it serves one goal: getting your supplier integration to production in days, not months . REST/JSON instead of SOAP/XML PromoStandards is a great idea: one standard instead of dozens of proprietary supplier APIs. But the transport it standardized on is SOAP/XML. In 2026, that means WSDLs, envelopes, namespaces, and hand-rolled XML parsing in ecosystems that stopped shipping good SOAP tooling a decade ago. PSRESTful puts a clean REST/JSON layer over every PromoStandards service: Product Data, Media Content, Pricing & Configuration (PPC), Inventory, Purchase Orders, Order Status, Shipment Notifications, and Invoices. Every endpoint follows a predictable, versioned URL pattern: curl -H "x-api-key: YOUR_API_KEY" \ "https://api.psrestful.com/v2.0.0/suppliers/{SUPPLIER_CODE}/inventory/{PRODUCT_ID}" You write the code once, and it works across every supplier. The payoff isn't just ergonomics: when we measured the move from XML to JSON , payloads shrank by 35–53%. And because everything is OpenAPI-based, you get an interactive API reference where every endpoint is documented and try-able. Protobuf, because JSON is sometimes still too heavy For most integrations JSON is plenty. But if you're syncing inventory and pricing across hundreds of suppliers, Product Pricing & Configuration responses can run into hundreds of kilobytes per product, and you're making thousands of calls per hour. That's why PSRESTful also serves Protocol Buffers ,

2026-07-21 原文 →
AI 资讯

The Tips Behind API Artisan: Building Laravel APIs Developers Actually Want to Use

I have just finished writing API Artisan: A Guide to Building APIs with Laravel , and I am giving it away for free. Before you commit to 300-odd pages, let me give you the short version: the tips, patterns, and small decisions that separate an API that technically works from one that developers are genuinely happy to depend on. None of this needs more hardware, a different framework, or a bigger team. It needs you to point your attention at the right things. These are the ones I keep coming back to. Start by measuring the right thing Ask most teams how they know their API is good and you get a single question back: does it work? Can I hit this endpoint and get a response? That question is necessary, and it is nowhere near enough. The question I want you to ask instead is whether your API is liveable with. Can a developer read your docs, understand your auth model, make a successful request, and handle an error without contacting support, trawling a forum, or guessing what a status code is trying to tell them? The gap between "works" and "liveable with" never shows up in a sprint retro, but it shows up everywhere else: in support volume, in integration timelines that overrun, and in the quiet moment a developer decides to build around your API rather than with it. Everything else in the book hangs off one mindset shift: an API is a product. It has users. Treat it as an implementation detail and it will behave like one. It will change without warning when your internals change, and it will be inconsistent because different people wrote different parts on different days with different conventions. Write the contract before the code The natural way to build an endpoint is to write the handler, return some data, and document it afterwards if there is time. It feels efficient, and in the short term it is. The problem is what it produces: a contract that was never designed, only discovered. Let me show you the trap, because I have watched it catch good developers. You have

2026-06-17 原文 →
开发者

Building an Edge REST API with Hono.js + TypeScript — From Bun Local Server to Cloudflare Workers

If you've ever built a REST API with Express, you've probably felt it. Middleware registration, type definitions, body parser setup, connecting Joi or Zod... the structure is simple, but the boilerplate is excessive. When I first saw Hono, I was skeptical. "Another Express clone," I thought. That changed when I actually ran it. Bottom line: Hono v4 is more than just lightweight and fast. TypeScript type inference flows naturally all the way to route handlers. Zod validation connects via a single official package. On Bun, response times are noticeably faster than Express. Everything in this post is based on what I ran in a sandbox in June 2026. Why Hono — Compared to Express and Fastify Understanding where Hono fits means answering three questions. Bundle size : Hono v4 core is about 12KB. Express is 58KB, Fastify is 77KB. The gap might not sound dramatic, but in edge environments like Cloudflare Workers or Deno Deploy, bundle size directly affects cold start time. Edge functions sometimes initialize a new runtime per request — smaller means faster first response. Runtime compatibility : Express is Node.js-only. Fastify targets Node.js by default. Hono was designed from the start to "run anywhere." The same code deploys to Bun, Deno, Cloudflare Workers, Node.js, and AWS Lambda Edge. TypeScript support : Express requires @types/express as a separate install, and properties added to req via middleware don't get type inference. Hono is written in TypeScript from the ground up, and the Hono<{ Bindings: Env; Variables: Variables }> generic gives you type-safe access to environment variables and middleware state. I'm not saying Hono is the right choice for every situation. If your team is deeply invested in Express, or you need a mature plugin ecosystem, there's no compelling reason to switch. But if edge deployment is the goal, or you want type safety from day one, Hono is the most convincing TypeScript API framework right now. Installation and First Server — Response in

2026-06-03 原文 →
AI 资讯

How I Shaved 10 MB Off My Portfolio in One Command

PageSpeed Insights had been staring at me for weeks. Desktop was holding at 91. Mobile was stuck at 63. I'd already fixed the obvious stuff — non-blocking fonts, preconnects, fetchpriority on the hero image. But there it was, every single run: Improve image delivery — Est savings of 985 KiB Nearly a megabyte of wasted transfer, just from six project screenshots. And that was just the images visible above the fold. The full list across all projects was worse. The culprit: every image I'd ever uploaded through the Django admin was a PNG. Some of them were over 1 MB. WebP would have cut most of them by 80%. I knew this. I just hadn't done anything about it. So I wrote a management command to fix the backlog, and then made the model auto-convert on every future upload so I'd never have to think about it again. The Problem With PNGs in a Portfolio When you're building a portfolio, you screenshot your work and drag it into the admin. That screenshot is usually a PNG — lossless, full-size, straight from your display. Nobody optimises it because the admin accepts it and it shows up fine in the browser. But "shows up fine" isn't the same as "loads fast." A 1.4 MB PNG of a law firm homepage does not need to be 1.4 MB. Served as WebP at quality 85, it's 175 KB. Same visual result. Eight times smaller. Multiply that across 28 projects and you're looking at tens of megabytes that mobile users on slow 4G are downloading just to scroll past thumbnails. The One-Time Backlog Fix: A Management Command First, I needed a way to convert everything that was already in S3. A management command was the right tool — it runs in the production container with full access to the Django ORM and the configured storage backend, so it can read and rewrite files without needing to know whether they're on S3, local disk, or anywhere else. # backend/projects/management/commands/convert_images_to_webp.py from io import BytesIO from django.core.files.base import ContentFile from django.core.management.b

2026-06-03 原文 →
AI 资讯

Interesting links - May 2026

Welcome to May’s Interesting Links ! This month saw the Current conference in London with the usual 5k run , lots of familiar faces and friendly conversations—and plenty of excellent breakout sessions too. It seems live-tweeting conferences isn’t a thing any more, with only myself and Thomas Cooper seeming to post anything, but if you want you can go review the hashtag feed on BlueSky for some highlights of the conference. I got my first Hacker News front page hit with AI Slop is Killing Online Communities (51k views and climbing!), and a nice little halo boost for another rant from earlier this year, AI will fsck you up if you’re not on board . Oh, and I got involved in some thought leadering over on LinkedIn ( which a non-zero number of people thought was serious ) with my shitposting about fried breakfasts . {{< il-header >}} Kafka and Event Streaming 🔥 Apache Kafka 4.3.0 has been released. Check out the release announcement , as well as a video from Sandon Jacobs covering the new features. 🔥 After a few quiet months on his blog, Jack Vanlightly is back with a bang! He’s written a new tool, Dimster, a performance benchmarking tool for Apache Kafka , and has written several more blog posts off the back of it: Benchmarking Apache Kafka Consumer Groups vs Share Groups (overhead test) . Kafka Share Groups and Parallelizing Consumption Part 1: Tuning max.poll.records , Part 2: Producer Batches and share.acquire.mode . 🔥 I had the absolute pleasure to watch Victor Rentea present at Devoxx UK earlier this month. This guy redefines what it means to be an entertaining, energetic, enthusiastic—and educational presenter. Whilst his specific talk, "Event-Driven Architecture Pitfalls" isn’t online yet, you can find the slides here , and a recording from Devoxx last year of a similar talk. The Parallel Consumer library from Confluent has been marked as no longer maintained, prompting a discussion of alternatives (and the concept itself) on LinkedIn, as well as a fork from one

2026-05-29 原文 →