{"id":1041,"date":"2026-07-02T06:46:40","date_gmt":"2026-07-01T23:46:40","guid":{"rendered":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/02\/building-a-real-time-polling-application-with-websocket-a-step-by-step-developers-guide\/"},"modified":"2026-07-02T06:46:41","modified_gmt":"2026-07-01T23:46:41","slug":"building-a-real-time-polling-application-with-websocket-a-step-by-step-developers-guide","status":"publish","type":"post","link":"https:\/\/sumberlaba.com\/index.php\/2026\/07\/02\/building-a-real-time-polling-application-with-websocket-a-step-by-step-developers-guide\/","title":{"rendered":"Building a Real-Time Polling Application with WebSocket: A Step-by-Step Developer\u2019s Guide"},"content":{"rendered":"<h1>Building a Real-Time Polling Application with WebSocket: A Step-by-Step Developer\u2019s Guide<\/h1>\n<p>In the modern web landscape, users expect instant feedback and live updates without manually refreshing a page. Traditional polling\u2014where the client repeatedly requests data from the server at set intervals\u2014works but is inefficient and creates unnecessary network load. WebSocket, on the other hand, provides a persistent, full-duplex communication channel between the client and server, making it the perfect technology for real-time features like live voting, collaborative editing, and multiplayer games. In this comprehensive tutorial, we will build a fully functional polling application from scratch using WebSocket technology. You will learn how to set up a Node.js WebSocket server, manage multiple polls and votes in real time, design a clean client interface, and handle essential concerns like broadcasting updates and reconnection. By the end of this guide, you will have a reusable, scalable foundation for any real-time feature you wish to implement. Whether you are a seasoned developer looking to refresh your real-time skills or a beginner eager to dive into WebSocket, this tutorial covers every detail with thorough explanations, code snippets, and best practices.<\/p>\n<p>Before we dive into the code, it is important to understand why WebSocket is the ideal choice for a polling app. In a typical HTTP-based polling system, the client sends a GET request every few seconds to check for new data, even when nothing has changed. This wastes bandwidth and server resources, and more importantly, introduces latency that can be anywhere from hundreds of milliseconds to seconds. WebSocket eliminates this inefficiency by establishing a single TCP connection that stays open. Both the server and client can push messages instantly. For a polling application\u2014where you want to see vote counts update the moment someone casts a vote\u2014WebSocket provides a seamless, near-instantaneous experience. Additionally, WebSocket messages are lightweight compared to HTTP headers, making it ideal for high-frequency updates. In this tutorial, we will use the `ws` library on the server side (Node.js) because it is lightweight and low-level, giving you full control over the message format. On the client side, we will use the built-in WebSocket API available in all modern browsers. We will also store voting data in memory for simplicity, but the same architecture can be extended to use a database or a publish\/subscribe system like Redis for horizontal scaling.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/sumberlaba.com\/wp-content\/uploads\/2026\/07\/article-1782949599076.jpg\" alt=\"Article illustration\" style=\"display:block;margin:20px auto;max-width:100%;height:auto;border-radius:8px;\" \/><\/p>\n<h2>Step 1: Setting Up the Project Structure and Dependencies<\/h2>\n<p>The first step in any software project is to create a clean, organized directory structure and install the necessary dependencies. We will build a Node.js application with a simple HTTP server that also handles WebSocket connections. Although we could use a framework like Express, we will keep things minimal to focus on the WebSocket logic. Create a new directory for your project, for example `websocket-polling-app`, and navigate into it. Initialize a Node.js project by running `npm init -y` in your terminal. This will generate a `package.json` file with default values. Next, install the `ws` library by running `npm install ws`. The `ws` library is a simple, fast, and well-tested WebSocket implementation for Node.js. No other dependencies are needed for the server side because Node.js includes the `http` module natively. For the client side, we will create a static HTML file served by the same Node.js server. To serve static files, we will use Node\u2019s built-in `fs` (file system) module. Alternatively, you could use a separate web server like Nginx or a framework like Express, but our approach keeps the tutorial self-contained. Your project folder should now contain the following files: `package.json`, `node_modules\/`, and later we will create `server.js` for the backend and `client.html` for the frontend. Create an empty `server.js` file and a `client.html` file. We will also create a `public` folder if you prefer, but for simplicity we will serve the HTML from the root. With the structure in place, we can move to the actual server code.<\/p>\n<h2>Step 2: Creating the WebSocket Server with Node.js<\/h2>\n<p>Now we will write the server script that combines an HTTP server for serving the static client file and a WebSocket server for real-time communication. Open `server.js` and require the `http`, `fs`, and `ws` modules. Start by creating an HTTP server using `http.createServer`. Inside the request handler, check the URL. If the request is for the root path (`\/`), read the `client.html` file using `fs.readFile` and send it back with the correct `Content-Type` header. For any other request, return a 404 status. This simple approach allows us to test the application without a separate static file server. After setting up the HTTP server, create a WebSocket server instance by passing the HTTP server to `new WebSocket.Server({ server })`. This attaches the WebSocket server to the same port as the HTTP server, typically port 8080 or 3000. Listen on the desired port and log a message to indicate the server is running. For the WebSocket server, we need to handle the `connection` event. When a client connects, a WebSocket object is created. We will set up event listeners for `message` and `close` on that object. Additionally, we will maintain a set of all connected clients so that we can broadcast messages to everyone. Use a `Map` or a simple array to store clients. For each new connection, add the client to the set and send a welcome message or the current state of all polls. At this point, your server is ready to accept WebSocket connections, but it does not yet handle poll-specific logic. We will implement that in the next step.<\/p>\n<h3>Server Code Outline<\/h3>\n<pre><code>const http = require('http');\nconst fs = require('fs');\nconst WebSocket = require('ws');\n\nconst server = http.createServer((req, res) => {\n  if (req.url === '\/') {\n    fs.readFile('client.html', (err, data) => {\n      res.writeHead(200, { 'Content-Type': 'text\/html' });\n      res.end(data);\n    });\n  } else {\n    res.writeHead(404);\n    res.end('Not found');\n  }\n});\n\nconst wss = new WebSocket.Server({ server });\n\nwss.on('connection', (ws) => {\n  \/\/ ... handle connection\n});\n\nserver.listen(8080, () => {\n  console.log('Server running on http:\/\/localhost:8080');\n});<\/code><\/pre>\n<h2>Step 3: Implementing the Polling Logic (Create Poll, Vote, Tally Results)<\/h2>\n<p>With the WebSocket server skeleton in place, we need to define the data structures and message protocols that will govern our polling app. We will store polls in an in-memory JavaScript object (or Map) where each poll has a unique ID, a question, an array of options, and a vote count for each option. To keep things organized, we will define a set of message types that the client and server can exchange. All messages will be JSON strings. The server will recognize the following types: `create_poll`, `vote`, `get_polls`. When a client sends a `create_poll` message, the server will generate a unique ID (using a simple incrementing counter or a UUID), store the poll, and broadcast the new poll to all connected clients. When a client sends a `vote` message containing a poll ID and an option index, the server will update the vote count for that option and broadcast the updated poll data to everyone. When a client sends a `get_polls` message (typically on initial connection), the server will send the full list of existing polls back to that specific client. Broadcasting is crucial because it ensures that every participant sees the same real-time view. To broadcast, we iterate over the set of connected WebSocket clients and send the JSON stringifyed message using `ws.send()`. However, we must be careful not to send messages to the client that triggered the update, because they already have the optimistic state. We can either let the client update its own UI optimistically or include the sender in the broadcast and let them ignore the echo. For simplicity, we will broadcast to all clients, including the sender, but the sender&#8217;s UI will be updated anyway (it is idempotent). The server should also validate that the poll exists and that the vote option index is within bounds. In a production app, you would also prevent duplicate votes from the same user via authentication or a cookie, but we will skip that for now.<\/p>\n<p>Below is a sample data structure for a poll:<\/p>\n<pre><code>{\n  id: 1,\n  question: \"What is your favorite programming language?\",\n  options: [\n    { text: \"JavaScript\", votes: 10 },\n    { text: \"Python\", votes: 8 },\n    { text: \"Go\", votes: 5 }\n  ],\n  totalVotes: 23\n}<\/code><\/pre>\n<p>When a vote arrives, we increment the `votes` property of the relevant option and recalculate `totalVotes`. Then we broadcast the updated poll object to all clients. The client will update its DOM accordingly. This pattern is straightforward and works well for a small to medium number of polls and concurrent users. To handle multiple polls, we simply store them all in an object keyed by ID. The server-side code will look something like this: on each `connection`, we set up a message handler that parses the JSON, determines the type, and calls the appropriate function. Remember to handle errors gracefully\u2014if the JSON is malformed, send an error message back to the client.<\/p>\n<h2>Step 4: Building the Client-Side HTML and JavaScript<\/h2>\n<p>Now let\u2019s switch to the frontend. The client will be a single HTML page that contains a form for creating a new poll and a list of existing polls with voting buttons. We will use plain HTML, CSS, and vanilla JavaScript to keep the focus on WebSocket integration. Start by creating a basic HTML5 document with a title, some styling (inline or separate), and a `<\/p>\n<div id=\"pollsContainer\">` where the polls will be rendered. Also include a `<\/p>\n<form id=\"createPollForm\">` with an input for the question and a textarea for options (each option on a new line). Add a submit button. In the JavaScript section (inside `<script>` tags), we first create a WebSocket connection: `const ws = new WebSocket('ws:\/\/localhost:8080');`. We then set up event handlers for `open`, `message`, `close`, and `error`. When the connection opens, we send a `get_polls` message to retrieve any existing polls from the server. When a message arrives, we parse the JSON and handle different types: `poll_created`, `vote_update`, `all_polls`. For `all_polls`, we clear the container and render each poll. For `poll_created`, we add the new poll to the UI (or re-render all). For `vote_update`, we update the vote counts for the specific poll in the UI. To avoid duplicate rendering, we can maintain a local state object mirroring the polls and only update the DOM elements that changed. However, for simplicity, we can re-render the entire poll list on each update\u2014this is acceptable for a small number of polls but may become performance-heavy with hundreds of polls. To render a poll, we create a `<\/p>\n<div>` with the question, a list of options (each as a clickable button), and a vote count display. When an option button is clicked, we send a `vote` message to the server containing the poll ID and the option index. We also prevent the default form submission behavior when creating a poll: serialize the form data, send a `create_poll` message, and clear the form. Remember to handle the case where the server is offline\u2014display a \"Connecting...\" message and attempt to reconnect automatically.<\/p>\n<p>The following is a snippet of the client-side WebSocket message handling:<\/p>\n<pre><code>ws.onmessage = (event) => {\n  const msg = JSON.parse(event.data);\n  switch (msg.type) {\n    case 'all_polls':\n      polls = msg.polls;\n      renderAllPolls();\n      break;\n    case 'poll_created':\n      polls.push(msg.poll);\n      renderAllPolls();\n      break;\n    case 'vote_update':\n      const updatedPoll = msg.poll;\n      const index = polls.findIndex(p => p.id === updatedPoll.id);\n      if (index !== -1) polls[index] = updatedPoll;\n      renderAllPolls();\n      break;\n  }\n};<\/code><\/pre>\n<h2>Step 5: Enhancing with Multiple Polls and Broadcasting<\/h2>\n<p>Our current implementation already supports multiple polls because we store them in an array on the server and send the entire list to each new client. However, when a vote is cast, we broadcast the updated poll to all clients. This works flawlessly because each client updates its local copy of that poll and re-renders. But there is a subtle bug: if two votes arrive at nearly the same time, the broadcast messages may arrive out of order or overwrite each other, causing a race condition. Because JavaScript is single-threaded on both the server and client, and WebSocket messages are processed sequentially, the risk is low but still present if the server uses asynchronous I\/O. A simple solution is to send the entire poll object after each vote, which includes the total vote count from the server's authoritative state. The client replaces its local copy, so even if messages are processed in order, the final state will be consistent. For a more robust solution, you could implement optimistic locking or use a single message queue, but for our tutorial, the simple broadcast works fine. Another enhancement is to allow users to see the number of unique voters. Since we are not tracking users, total votes equal the sum of all option votes. You could add a `voterIds` set per poll, but that requires some form of user identification. For now, we keep it anonymous. Broadcasting is also useful for informing all clients when a poll is deleted or closed. We can add a `close_poll` message type, but we will leave that as an exercise. The key takeaway is that the server is the single source of truth, and every state change is pushed to all clients using the same broadcast pattern.<\/p>\n<h2>Step 6: Adding Error Handling and Reconnection Logic<\/h2>\n<p>No real-world application is complete without robust error handling and resilience against network interruptions. On the client side, the WebSocket object can trigger an `onclose` event when the connection drops. We should implement a reconnection strategy with exponential backoff to avoid overwhelming the server. For example, on a disconnection, wait 1 second before attempting to reconnect, then 2 seconds, then 4, up to a maximum of 30 seconds. Use `setTimeout` and `ws = new WebSocket(...)`. Also, when the connection is re-established, the client should re-fetch the current state by sending a `get_polls` message. The server, upon receiving a new connection, should send the full state. On the server side, handle errors such as invalid JSON or malformed messages gracefully. Catch exceptions from `JSON.parse` and send an error message back to the offending client, or simply ignore the message. Also, clean up the client set when a client disconnects. In the `close` event listener, remove the WebSocket object from the list of clients. This prevents memory leaks and ensures broadcast doesn't fail. Additionally, consider adding a heartbeat (ping\/pong) mechanism to detect stale connections. The `ws` library supports ping\/pong automatically, but you can also implement your own. For a full production app, you would also handle scenarios where the server restarts and the in-memory polls are lost. That's when you'd integrate a database or Redis. But for our tutorial, we focus on the WebSocket flow.<\/p>\n<h2>Tips and Best Practices for Building WebSocket Polling Apps<\/h2>\n<h3>1. Always Validate Input on the Server<\/h3>\n<p>Never trust data coming from clients. Even though WebSocket connections are typically from your own frontend, malicious users can send crafted messages directly to the server port. Validate that poll questions are not empty, that option indices are numbers within the option array length, and that vote counts do not exceed reasonable limits. Use a simple whitelist of allowed message types. This not only prevents data corruption but also protects against potential injection attacks. For example, do not allow option text to contain script tags if you are rendering them without escaping. Either escape HTML entities on the server before storing or on the client before rendering.<\/p>\n<h3>2. Consider Using a Higher-Level Library Like Socket.IO for Production<\/h3>\n<p>While the `ws` library is excellent for learning and lightweight use cases, Socket.IO provides automatic reconnection, fallback transports (long-polling when WebSocket is not available), rooms, and namespaces. For a production polling app that serves a diverse audience, Socket.IO can save you weeks of development time. It also handles message acknowledgments and broadcasting with less boilerplate. However, the core concepts you learned with `ws` apply directly to Socket.IO\u2014they both use WebSocket under the hood. Choose based on your project\u2019s complexity and scalability needs.<\/p>\n<h3>3. Use a Pub\/Sub Mechanism for Horizontal Scaling<\/h3>\n<p>If your polling app grows to thousands of concurrent users, a single Node.js process may not suffice. To scale horizontally, you need to run multiple server instances behind a load balancer. But WebSocket connections are sticky\u2014a client must stay connected to the same server instance. To broadcast a vote update to all clients across all instances, you need an external pub\/sub system like Redis. Use the `redis` package to publish messages on one channel, and all server instances subscribe to that channel and forward the message to their own connected clients. This pattern is well-documented and essential for real-time apps at scale. Even for a small tutorial, it's good to be aware of this limitation.<\/p>\n<h2>Reference Tables<\/h2>\n<h3>Table 1: WebSocket Message Types and Payloads<\/h3>\n<table border=\"1\" cellpadding=\"8\" cellspacing=\"0\">\n<thead>\n<tr>\n<th>Message Type (Direction)<\/th>\n<th>Client \u2192 Server Payload<\/th>\n<th>Server \u2192 Client Payload<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>create_poll<\/code><\/td>\n<td><code>{ type: \"create_poll\", question: string, options: string[] }<\/code><\/td>\n<td><code>{ type: \"poll_created\", poll: PollObject }<\/code><\/td>\n<td>Client asks to create a new poll; server broadcasts the new poll to all.<\/td>\n<\/tr>\n<tr>\n<td><code>vote<\/code><\/td>\n<td><code>{ type: \"vote\", pollId: number, optionIndex: number }<\/code><\/td>\n<td><code>{ type: \"vote_update\", poll: PollObject }<\/code><\/td>\n<td>Client casts a vote; server updates counts and broadcasts the updated poll.<\/td>\n<\/tr>\n<tr>\n<td><code>get_polls<\/code><\/td>\n<td><code>{ type: \"get_polls\" }<\/code><\/td>\n<td><code>{ type: \"all_polls\", polls: PollObject[] }<\/code><\/td>\n<td>Client requests current state (usually on connect).<\/td>\n<\/tr>\n<tr>\n<td><code>error<\/code><\/td>\n<td>N\/A<\/td>\n<td><code>{ type: \"error\", message: string }<\/code><\/td>\n<td>Server sends error info to a specific client.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Table 2: Comparison of Real-Time Communication Techniques<\/h3>\n<table border=\"1\" cellpadding=\"8\" cellspacing=\"0\">\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>HTTP Polling (Short &amp; Long)<\/th>\n<th>WebSocket<\/th>\n<th>Server-Sent Events (SSE)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Connection type<\/td>\n<td>Multiple HTTP requests<\/td>\n<td>Persistent TCP connection<\/td>\n<td>Persistent HTTP connection<\/td>\n<\/tr>\n<tr>\n<td>Latency<\/td>\n<td>High (depends on interval)<\/td>\n<td>Low (real-time)<\/td>\n<td>Low (real-time)<\/td>\n<\/tr>\n<tr>\n<td>Server push<\/td>\n<td>No (client must request)<\/td>\n<td>Yes (bidirectional)<\/td>\n<td>Yes (unidirectional)<\/td>\n<\/tr>\n<tr>\n<td>Protocol overhead<\/td>\n<td>High (HTTP headers each request)<\/td>\n<td>Low (minimal framing)<\/td>\n<td>Medium (HTTP headers once)<\/td>\n<\/tr>\n<tr>\n<td>Browser support<\/td>\n<td>Universal<\/td>\n<td>Wide (IE10+), fallback possible<\/td>\n<td>Good but no IE\/Edge legacy<\/td>\n<\/tr>\n<tr>\n<td>Suitable for polling app<\/td>\n<td>Poor (wasteful, slow)<\/td>\n<td>Excellent<\/td>\n<td>Good if only server pushes results<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Frequently Asked Questions (FAQ)<\/h2>\n<h3>Q1: Can I use WebSocket with a different backend language like Python or Go?<\/h3>\n<p>Absolutely. The WebSocket protocol is language-agnostic. You can implement the server in any language that provides a WebSocket library\u2014for example, Python with `websockets`, Go with `gorilla\/websocket`, or Java with `javax.websocket`. The client-side JavaScript remains the same because it uses the browser\u2019s built-in WebSocket API. The concepts of message handling, broadcasting, and state management apply universally. In this tutorial we used Node.js for its non-blocking I\/O and ease of setup, but the same patterns translate directly to other stacks.<\/p>\n<h3>Q2: How do I handle authentication in a WebSocket polling app?<\/h3>\n<p>WebSocket connections can be authenticated in several ways. The most common approach is to pass a token (JWT) during the initial handshake via a query parameter (e.g., `ws:\/\/server?token=...`). The server verifies the token in the `connection` event before accepting the socket. Alternatively, you can require the client to send an authentication message as the first message after opening the connection. If the authentication fails, close the socket. For a polling app, you might want to associate votes with user IDs to prevent duplicate voting. Store the user ID in a map on the server keyed by the WebSocket connection, and when a vote message arrives, check if that user has already voted on that poll.<\/p>\n<h3>Q3: What happens if I have thousands of polls and millions of users? Will the broadcast pattern still work?<\/h3>\n<p>Broadcasting the entire poll list to every new client and sending updated poll objects on every vote will eventually become a bottleneck. For high-scale scenarios, you should optimize by only sending the polls that have changed (incremental updates) and only to clients who are interested (e.g., using channels\/rooms). Libraries like Socket.IO provide built-in room functionality. You can also implement a caching layer (e.g., in-memory cache with invalidation) to avoid recomputing the state. For the scope of this tutorial, the simple broadcast pattern is a solid starting point, but always consider scaling early if you expect significant traffic.<\/p>\n<h3>Q4: How do I ensure data persistence across server restarts?<\/h3>\n<p>In our tutorial, we stored polls in memory, meaning all data is lost if the server crashes or restarts. To persist data, integrate a database like MongoDB, PostgreSQL, or even a simple JSON file (for low volume). On server start, load existing polls from the database. On every state change (create poll, vote), update the database accordingly. When broadcasting, you can still send in-memory representations for speed, but ensure the database is the authoritative source. For a live polling app, you might also want to use a write-ahead log or a fast key-value store like Redis to handle high write loads.<\/p>\n<h3>Q5: Is it possible to run the WebSocket server and the static file server on different ports?<\/h3>\n<p>Yes, you can. For development, running everything on one port (like we did) is convenient. In production, you might serve static assets via a CDN or a dedicated web server (Nginx, Apache) and have the WebSocket server run on a separate port (e.g., 8080). The client JavaScript would then connect to `ws:\/\/yourdomain.com:8080`. However, this introduces cross-origin issues. The WebSocket server must include the appropriate CORS headers (or use the `origin` check in the `ws` library). Alternatively, you can use a reverse proxy (like Nginx) to route requests based on path or upgrade headers, keeping everything on port 80\/443. That is the most common production setup.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this comprehensive tutorial, you have learned how to build a fully functional real-time polling application using WebSocket technology. We started by setting up a Node.js environment with the `ws` library, then implemented a server that handles multiple polls, records votes, and broadcasts updates to all connected clients. We built a client-side interface that communicates with the server using the native WebSocket API, and we covered essential enhancements like reconnection logic and error handling. You also saw how WebSocket outperforms traditional HTTP polling in terms of latency, efficiency, and user experience. Finally, we discussed best practices regarding input validation, scaling with pub\/sub, and the trade-offs of using higher-level libraries. With this foundation, you can now extend the application with features like user authentication, persistent storage, real-time charts, or even integrate it into a larger platform. The real-time web is no longer a luxury but an expectation, and WebSocket is the key enabler. Go ahead and experiment\u2014create a poll, cast a vote, and watch the numbers update instantly. That immediate feedback loop is the power of WebSocket, and now you have the skills to harness it for any live data application.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Building a Real-Time Polling Application with WebSocket: A Step-by-Step Developer\u2019s Guide In the modern web landscape, users expect instant feedback and live updates without manually refreshing a page. Traditional polling\u2014where the client repeatedly requests data from the server at set intervals\u2014works but is inefficient and creates unnecessary network load. WebSocket, on the other hand, provides &hellip; <\/p>\n","protected":false},"author":2716,"featured_media":1040,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1041","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-non-category"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/users\/2716"}],"replies":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/comments?post=1041"}],"version-history":[{"count":1,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1041\/revisions"}],"predecessor-version":[{"id":1042,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/posts\/1041\/revisions\/1042"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media\/1040"}],"wp:attachment":[{"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumberlaba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}