How to update a Hyperlink field using REST API in SharePoint 2013

below code snippet helps to update the Hyper link filed in SharePoint 2013 using REST API


$.ajax
    ({
        url: _spPageContextInfo.webAbsoluteUrl + "/_api/site/rootweb/lists/GetByTitle('ListName')/items",
        type: "POST",
         headers:
        {
            "Accept": "application/json;odata=verbose",
            "Content-Type": "application/json;odata=verbose",
            "X-RequestDigest": $("#__REQUESTDIGEST").val(),
            "X-HTTP-Method": "POST"
        },
         data: JSON.stringify
        ({
            __metadata:
            {
                type: "SP.Data.ListnameListItem"
            },
             Link:{Url: 'http://google.com', Description:'Google'}
        }),
        success: function(data, status, xhr)
        { // alert('success');
         
        },
        error: function(xhr, status, error)
        {
            //$("#ResultDiv").empty().text(data.responseJSON.error);
        }
    });  

Comments

Popular posts from this blog

Clearing the Configuration Cache for SharePoint

SharePoint 2013 REST API CRUD Operations

Add List Item Attachments to Task Form using Nintex Workflow and Forms