Filter
Exclude
Time range
-
Near
🔌 Fetching & Status Codes Making a basic GET request with http.Get(url) is simple, but handling it correctly requires a couple of steps. First, checking the error return value is a necessity. Next, you have to verify StatusCode to make sure the server actually returned a 200 OK
1
1
AI Agents 12 : நீங்க மறக்கக் கூடாத 200 மற்றும் 404 #ai #agenticai #statuscode
2
68
statusCode / 100 != 2 みたいなコードが流れて来たので試してみたのですが、最近のCコンパイラは賢いですね。整数の範囲チェックは全部同じコードになるようです。 godbolt.org/z/TYaodce7e
16
36
4,908
Replying to @takehiro_t
statusCodeがレジスタより小さな整数型であるかどうかの確認からですね!(実際は範囲チェックに最適化されるっぽいです
9
2,627
statusCode / 100 == 2 は整数の除算結果が必ず整数である言語でのみ通じるやり方なので、僕はそっちメインじゃないから一目見てすごい違和感ありました
2
168
Replying to @yusuke
言葉足らずですみません! 3,4 枚目の画像について、statusCode /100 は通常 1〜9 になるはずなので、== 200 だと常に false になってしまいチェックとして正しくないのでは?という意図だったのですが、おそらく本題はここではなさそうだったので瑣末なことだったなと…🙇

Replying to @yusuke
200だけでなく200台をちゃんとカバーしたいなら自分ならこう書くかな。
1
1
3
1,026
Replying to @felice90
そう、statusCodeはintを返します。が、自分なら説明用の変数に代入しますね

Replying to @yusuke
200だけでなく200台をちゃんとカバーしたいなら自分ならこう書くかな。
2
12,893
Replying to @mattn_jp
純粋に教えて欲しいのですが、私だったらswitch statusCode {…}とするか、 if statusCode == 200 { __ } else if statusCode == 201 { __ } と書いてしまいそうですが、引用の分岐はどんなメリットがあるんですか?
1
5
25,666
🧨 Still throwing errors the old way? JS has 3 modern primitives: 1. Custom Error classes with structured fields like statusCode 2. Error.cause to wrap errors and keep the chain 3. AggregateError when many things fail at once Snippet below 👇
4
7
81
6,634
Websites gebruiken die codes om succes, fouten en verplaatsingen terug naar de browser te sturen. Zo is er naast 404 ook 418, "I am a teapot", wat een 1 april grap was die nu dus letterlijk als een bekende statuscode geregistreerd staat 😅
1
3
100
The backend team says the API will be ready "next sprint." You've heard that before. So you spin up Express, write 200 lines of throwaway mock server code, wire up 4 endpoints, and spend the afternoon debugging CORS headers on something that'll be deleted in 2 weeks. Classic. Dev Proxy skips all of that. You write a JSON file: { "$schema": "raw.githubusercontent.com/do…", "mocks": [ { "request": { "url": "api.contoso.com/users/*", "method": "GET" }, "response": { "statusCode": 200, "body": { "id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd", "displayName": "Adele Vance", "mail": "AdeleV@contoso.com" } } } ] } Start the proxy. Your app's API calls get intercepted and return your mock data. Zero code changes to your application (seriously, none). The wildcard `*` matches any user ID, so one mock covers every `/users/{id}` call. First match wins when you define multiple mocks for the same URL. That matters when you want specific IDs to return specific data while everything else hits a fallback. You can also reference files for response bodies. Got a big JSON payload? Point to it with `@response.json` instead of inlining it. The part worth paying attention to: set `blockUnmockedRequests: true` and Dev Proxy returns a 502 for any request you didn't mock. That turns your mock setup into a coverage check. If your app calls an endpoint you forgot, you'll know immediately instead of finding out in staging. When the real API ships, stop the proxy. Done. How do you handle the gap between "API spec is ready" and "API is actually working"?
1
2
164
Replying to @MathiasChu
Mi veredicto: if (statusCode === 200) success(response) else error(response); le devolvió 201
2
338
あ、NAI Smart Studioの 『Exception: 生成HTTPエラー 400: {"statusCode":400,"message":"INVALID_CACHE_KEYS","details":{"invalidKeys":[" 』ってやつは次回あたりのアプデでなおる予定です。 ソフトを一定期間放置してると、精密参照とかのキャッシュが切れてしまっていたのでその修正になります。
3
888
Coinbase, Stripe und weitere Technologiekonzerne arbeiten daran, Zahlungen im Internet grundlegend zu verändern. Im Zentrum steht das offene x402-Protokoll, das den lange ungenutzten HTTP-Statuscode 402 Payment Required praktisch wiederbelebt. Statt dass ein Nutzer erst ein Konto anlegt, eine Kreditkarte hinterlegt oder einen API-Schlüssel beantragt, kann ein Dienst direkt in einer Webanfrage mitteilen: Für diese Ressource ist eine Zahlung nötig. Der anfragende Client – also ein Programm, ein Bot oder ein KI-Agent – kann die Zahlung anschließend sofort ausführen und die Anfrage erneut absenden. Coinbase beschreibt x402 als offenes Protokoll für automatische Stablecoin-Zahlungen über HTTP; Stripe hat x402 inzwischen in seine „Machine Payments“-Infrastruktur eingebunden. #coinbase #stripe #banken #geld #payment #zahlungsverkehr #markusmiller #money #stablecoins
1
1
3
417
YOU DON'T NEED 6 months to learn Node.js. if you already write frontend JS, you're closer than you think. here's how to go from frontend dev to fullstack in under a week: 1. understand that Node.js IS JavaScript. same syntax, same logic. you already know 70% of it. stop overthinking. 2. learn how `require` and `import` work in Node. ES modules vs CommonJS. that's it. one concept. 3. build a basic HTTP server with the built-in `http` module. no Express yet. just req, res, statusCode. feel the raw power. 4. understand the `fs` module. read a file. write a file. that's your first backend superpower , talking to the file system. 5. learn `path` and `process.env`. know where your files live. know how to hide your secrets. two things frontend devs never think about. 6. NOW install Express. set up 3 routes: GET, POST, DELETE. that's literally a CRUD app skeleton. you already know JSON from fetch calls. 7. connect to a database. pick PostgreSQL. one CREATE TABLE, one INSERT, one SELECT. SQL is not scary , it's just structured googling. 8. add middleware. express.json(), a logger, an auth check. middleware is just functions that run before your route. you've been writing functions your whole career. 9. use environment variables with dotenv. never hardcode a password. never push secrets to GitHub. this alone makes you more professional than half the backend devs out there. 10. Deploy it. spin up a free server on Render or Railway. push your code. hit your API from your browser. that moment when your frontend calls YOUR backend? believe me , it's just the unmatched dopamine : D you don't need a course. you need a blank editor and 5 days of building. just take one step a time, instead of overthinking on tiny feature end to end ! Happy Building guys !!
6
8
64
3,528
Day 9 – Chai Aur Backend ✅ • Standard APIs: JSON (statusCode, data, message, success) • asyncHandler to avoid try/catch (Promise.resolve().catch()) • ApiError (extends Error) with statusCode ApiResponse for success handling Reusable utils @Hiteshdotcom @ChaiCodeHQ @nirudhuuu
17
88
Day 9 - Chai Aur Backend ✅ 1. Ensure backend standardization so every API returns consistent JSON with fixed keys like statusCode, data, message, success. 2. Use asyncHandler to wrap controllers and avoid repetitive try/catch using Promise.resolve().catch(next). 3. Extend Node’s Error class to create ApiError with statusCode, message, errors, and stack. 4. Create ApiResponse for success with statusCode, data, message, and success flag. 5. Export utilities for reuse across all controllers. @Hiteshdotcom @ChaiCodeHQ @piyushgarg_dev @nirudhuuu @yntpdotme @surajtwt_ @devwithjay
2
56
486
"status": "success" "statusCode": 200 "message": "Vehicle verified successfully" "timestamp": "2026-04-17T20:59:00Z" "registrationNumber": "KBN547W", "yearOfManufacture": 2017 "fullName": "Rudolf Mumia Isinga" "provider": "The Monarch Insurance Company Ltd
2
536