'How to update a single property using PATCH method in Node JS? [closed]

I want to create a PATCH method to update a single property for my API but there is something I don't understand.



Solution 1:[1]

You should Clearly post your question, this is what i understand, i hope this will help you if you are using request npm in node.js

var request = require('request');

request.patch(
    //First parameter API to make post request
    'https://example.com/api/users',

    //The second parameter, DATA which has to be sent to API
    { json: {
        name: "paul rudd",
        movies: ["I Love You Man", "Role Models"]
      } 
    },
    
    //The third parameter is a Callback function 
    function (error, response, body) {
        if (!error && response.statusCode == 200) {
            console.log(body);
            console.log(response.statusCode);
        }
    }
);

for more information read here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Saad Abbasi