REST

164

Solutions

339

Contributors

Representational state transfer (REST) is an architectural style that gives a coordinated set of constraints to the design of components in a distributed hypermedia system used to design networked applications. RESTful systems typically communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) that web browsers use to retrieve web pages and to send data to remote servers. REST interfaces with external systems using resources identified by Uniform Resource Identifier (URI) that can be operated upon using standard verbs.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello fellas,

This is my first question and I really require assistance on this case I'm working on.

My friend's PC has an 1TB Samsung Hard Drive that was partitioned to three pieces, but last week suddenly it shows on Windows Explorer and Disk Management the System Reserved drive, with only 150GB. (please see attachment capture).

System Information:
OS: Windows 8.1 Pro
Version: 6.3.9600 Build 9600
Processor: Intel(R) Core (TM) i7 CPU
Dell Inc. x64 based PC
BIOS version date: DELL INC., A15, 2/4/2010.

I checked on Event Viewer and it showed on August 13th, 2017 that the Volume D: has been repaired. This event showed up 13 times or more in a row between seconds. (warning event)

Then it brought up the error event on the same day, which said A corruption was discovered in the file system structure on volume D:

The Master File Table (MFT) contains a corrupted file record.  The file reference number is 0x1000000000018.  The name of the file is "<unable to determine file name>".

//
Now knowing these, I checked for viruses and unwanted programs, from the basics of course. Then I was checking the partitions but my main concern is the fact that the remaining space, the other hidden disk drive have no weight on it whatsoever, just an empty letter assigned to each one of them, which is why I can't make recovery.

I tried looking the data of these partitions (important) with DISKPART but no help, I installed the Mini Tool Partition Wizard to see if I could …
0
New benefit for Premium Members - Upgrade now!
LVL 9
New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Hello,

I am trying to access an endpoint with API using Basic authentication (Username and password).  I tried two methods that did not work for me.

Method 1:

var apiTest = new XMLHttpRequest();
var username ='testUser';
var password ='letUserIn1#';
apiTest.open('GET', 'https://internal.com/agency');
apiTest.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password));
apiTest.setRequestHeader('Accept', 'application/json');

apiTest.onload = function() {
                var apiData = JSON.parse(apiTest.responseText);
                console.log(apiData[0]);
};

apiTest.send();

Open in new window

I get the following error for method 1 in Chrome:
chromeErrorI get this in IE
IE Error
Method 2:
$.ajax({
    url: 'https://internal.com/agency',
    method: 'GET',
    crossDomain: true,
    beforeSend: function ( xhr ) {
        xhr.setRequestHeader( 'Authorization', 'Basic ' + Base64.encode( 'testUser:letUserIn1#') );
    },
    success: function( data, txtStatus, xhr ) {
        console.log( data );
        console.log( xhr.status );
    }
});

Open in new window

Here's the error I get:
errorI get the same error in IE.  Base64 is undefined.

Any help would be much appreciated.

Thanks!
0
Hi Friends,

according to my work,I have number of pdf files present in one folder .I need to merge all the files into a single pdf  file  based on last modified time stamp. Means first modified pdf file as first and then the rest.
I tried with the below code.

Sub Main() 
     
    Const DestFile As String = "MergedFile.pdf" ' <-- change to suit
     
    Dim MyPath As String, MyFiles As String 
    Dim a() As String, i As Long, f As String 
     
     ' Choose the folder or just replace that part by: MyPath = Range("E3")
    With Application.FileDialog(msoFileDialogFolderPicker) 
         '.InitialFileName = "C:\Temp\"
        .AllowMultiSelect = False 
        If .Show = False Then Exit Sub 
        MyPath = .SelectedItems(1) 
        DoEvents 
    End With 
     
     ' Populate the array a() by PDF file names
    If Right(MyPath, 1) <> "\" Then MyPath = MyPath & "\" 
    ReDim a(1 To 2 ^ 14) 
    f = Dir(MyPath & "*.pdf") 
    While Len(f) 
        If StrComp(f, DestFile, vbTextCompare) Then 
            i = i + 1 
            a(i) = f 
        End If 
        f = Dir() 
    Wend 
     
     ' Merge PDFs
    If i Then 
        ReDim Preserve a(1 To i) 
        MyFiles = Join(a, ",") 
        Application.StatusBar = "Merging, please wait ..." 
        Call MergePDFs(MyPath, MyFiles, DestFile) 
        Application.StatusBar = False 
    Else 
        MsgBox "No PDF files found in" & vbLf & MyPath, vbExclamation, "Canceled" 
    End If 
     
End Sub 
 
Sub 

Open in new window

0
i am new to rest api.
i want to implement REST API for my project which is developed with Spring framework.
i want to implement  REST API in best way.

Please provide sugggistions for design and development.
0
Here is the code

Function EIGEN_JK(ByRef M As Variant) As Variant

'***************************************************************************
'**  Function computes the eigenvalues and eigenvectors for a real        **
'**  symmetric positive definite matrix using the "JK Method".  The       **
'**  first column of the return matrix contains the eigenvalues and       **
'**  the rest of the p+1 columns contain the eigenvectors.                **
'**  See:                                                                 **
'**  KAISER,H.F. (1972) "THE JK METHOD: A PROCEDURE FOR FINDING THE       **
'**  EIGENVALUES OF A REAL SYMMETRIC MATRIX", The Computer Journal,       **
'**  VOL.15, 271-273.                                                     **
'***************************************************************************

Dim A() As Variant, Ematrix() As Double
Dim i As Long, j As Long, k As Long, iter As Long, p As Long
Dim den As Double, hold As Double, Sin_ As Double, num As Double
Dim Sin2 As Double, Cos2 As Double, Cos_ As Double, Test As Double
Dim Tan2 As Double, Cot2 As Double, tmp As Double
Const eps As Double = 1E-16
   
    On Error GoTo EndProc
   
    A = M
    p = UBound(A, 1)
    ReDim Ematrix(1 To p, 1 To p + 1)
   
    For iter = 1 To 15
       
        'Orthogonalize pairs of columns in upper off diag
        For j = 1 To p - 1
            For k = j + 1 To p
               
                den = 0#
               …
0
I have a REST call using jQuery Ajax and it works fine on every browser except for IE11.  When I make this POST call,  I get back a 400 error and the data doesn't get written.

Any advise on this would be greatly appreciated.
0
I am writing a REST client application using Embarcadero C++ builder Xe10.1 Berlin.
I need to have the REST server IP address configurable.
I have initially set the TRESTClient component BaseURL property to a known server IP address in the IDE. The BaseURL property value is http://10.41.9.27:8080 and the application works just fine.
If I add code to change the BaseURL property however, the application doesn't respond and times out ?
Even if I use the value that works when set in the IDE, after the following code is run the application stops working ?

RESTClient1->BaseURL = u"http://10.41.9.27:8080";

Open in new window


Any ideas please ?
0
Using intel S1200BTL Server board with 4x3TB SATA HDD's.
Would like to have at least 150GB OS Drive and the rest as DATA drive.
Should I use ESRT2 or RST?
1
I am using REST API with SharePoint 2013 and I want to know if the following url endpoint is legal or if there is a better way?
 //http://myspsite.com/nrm/_api/web/lists/getbyTitle('My_Project_Modules')/items?$select=DIR,Station,Title,Building_x0020_Number&$filter=Project_x0020_Number eq '402-CSI-001'     //<---  Works when I paste it in the browser
 var projNum = '402-CSI-001';
var endPointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbyTitle('My_Project_Modules')/items?$select=DIR,Station,Title,Building_x0020_Number&$filter=Project_x0020_Number eq "+projNum;  //<---  Not valid when I run it in my code

Open in new window


Error I get in my js file
rest api error
js file
function loadSPItems() {
var projNum = '402-CSI-001';
var endPointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbyTitle('My_Project_Modules')/items?$select=VISN,Station,Title,Building_x0020_Number&$filter=Project_x0020_Number eq "+projNum;//,ProjectNumber,ApprovalStatus,ProjectExecutionStatus”;
var headers = { 
	"accept": "application/json;odata=verbose" 
}
 
jQuery.ajax({ 
	url: endPointUrl, 
	type: "GET", 
	headers: headers, 
success: function (data) {
	console.dir(data);
}, 
	error: function (err) { 
	alert("Error Occured:" + JSON.stringify(err)); 
}
 
});
 
}

loadSPItems();

Open in new window




Thoughts?
0
I have a simple REST Api app and have no issues when sending a GET request, everything works as expected. However, when I send either a PUT, POST or DELETE request, I just get 204 - No Data response and none of the code in the relevant methods is executed.

This what I have in my WebAPIConfig.vb file:

Public Module WebApiConfig
    Public Sub Register(ByVal config As HttpConfiguration)
        ' Web API configuration and services

        ' Web API routes
        config.MapHttpAttributeRoutes()

        config.Routes.MapHttpRoute(
            name:="DefaultApi",
            routeTemplate:="api/{controller}/{id}",
            defaults:=New With {.id = RouteParameter.Optional}
        )

    End Sub

End Module 

Open in new window


and the PUT method in the controller is simply logging the fact we got a request, but the code doesn't run:

' PUT: api/Barcode/5
        Public Sub PutValue(ByVal id As Integer, <FromBody()> ByVal value As String)

            auditLog("REST Call", "Received PUT request", False, False)

        End Sub

Open in new window

0
Technology Partners: We Want Your Opinion!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Hi All,,,

Requirement is as follows:
(It may sound crazy or stupid but I welcome any better suggestions).
- I am pulling out a set of records in a Continuous Form based on a selection Query.
- When I update a text field, I want the change to reflect in the same field in the rest of the record set.

I did an Update Query which I run in the 'After Update event'  of the field.
Two scenarios:
1- When I include a Saverecord in the update event after running the Updating Query, I get the attached Error Message.
2- If I don't Saverecord in the AfterUdate, then I get caught with the same error message upon closing the form.

In both cases, the update query does its job very well.

On the Error Message:
- If I choose 'Copy to Clip Board', 'Save Record' or 'Drop Changes', nothing happens and  I can continue to close and nothing is affected to the updated fields.

I have observed the behavior very closely and it is fine EXCEPT the annoying Error Message, which sounds scaring.

Please advise of :
- Either a way to suppress the Error Message, or
- A better suggestion to achieve the requirement.


Many Thanks

BTW:
This is not a multiuser environment not even a split DB. It is confined to my PC only as it is still under development .

Write Conflic1
0
How to parse the  JSON Data using Rest web service give me a simple example
0
Hi Experts,

I have created a google rest api call using postman and can successfully retrieve an email from my gmail account. However, I need to extract some text from the body and it is coming back encrypted such as below

 "body": {
          "size": 2717,
          "data": "PCFkb2N0eXBlIGh0bWw-DQo8aHRtbD4NCjxoZWFkPg0KPG1ldGEgY2hhcnNldD0iVVRGLTgiPg0KPHRpdGxlPkNvbXBsZXRlIHlvdXIgUmVnaXN0cmF0aW9uPC90aXRsZT4NCjwvaGVhZD4NCg0KPGJvZHkgc3R5bGU9ImZvbnQtZmFtaWx5OkdvdGhhbSwgJ0hlbHZldGljYSBOZXVlJywgSGVsdmV0aWNhLCBBcmlhbCwgc2Fucy1zZXJpZjsgbGluZS1oZWlnaHQ6MS42ZW07IGZvbnQtc2l6ZToxNHB4Ij4NCjwhLS1baWYgbXNvXT4NCgk8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCQlib2R5LCB0YWJsZSwgdGQge2ZvbnQtZmFtaWx5OkFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYgIWltcG9ydGFudDsgbGluZS1oZWlnaHQ6MS42ZW07fQ0KCTwvc3R5bGU-DQo8IVtlbmRpZl0tLT4NCgk8dGFibGUgc3R5bGU9InBhZGRpbmc6MTBweDsgd2lkdGg6YXV0bzsgbWFyZ2luOjAgMTAlIj4NCiAgICAJPHRyPg0KCQkJPHRkPg0KCQkJCQk8cCBzdHlsZT0idGV4dC1hbGlnbjpjZW50ZXI7Ij4NCgkJCQkJPGltZyBzcmM9ImNp.........

Open in new window


Has anyone had experience extracting data from the body or can offer any suggestions on how I can convert the data field into someting rreadable

Thanks
0
Hello all,
our HTTP packets go via a proxy, unlike the rest of the TCP/IP packets.
so using ping to measure the latency between us and a webserver won't be very accurate. we need to measure latency over HTTP instead of ICMP.
any help ?
0
I have the below code that is returning undefined. How to rewrite so it uses a promise or similar mechanism to ensure addTSRecord returns the id to TimesheetRecords?

TimesheetRecords[i].id = addTSRecord(TimesheetRecords[i].RowID, moment(myWE).subtract(6, 'd').toISOString(), TimesheetRecords[i].TSStaffId, TimesheetRecords[i].Hours, TimesheetRecords[i].TSTaskId);						

function addTSRecord(myRow, myDate, myTSStaffID, myHours, myTSTaskID) {

		var endpointUrl = mySite + "/_api/web/lists/getbytitle('timesheets')/items";
		
		call;

		var call = $.ajax({
    		url: endpointUrl,
    		type: "POST",
    		data: JSON.stringify({
    			"__metadata": { type: "SP.Data.TimesheetsListItem" },
    			RowID: myRow,
    			TSDate: myDate,
    			TSStaffId: myTSStaffID,
			Hours: myHours,
			TSTaskId: myTSTaskID
	        }),
    		headers: {
    			Accept: "application/json;odata=verbose",
    			"Content-Type": "application/json;odata=verbose",
    			"X-RequestDigest": myFormDigest
    		}
		});

		call.done(function (data, textStatus, jqXHR) {
			return data.d.Id;
		});

		call.fail(function (jqXHR, textStatus, errorThrown) {
    		var response = JSON.parse(jqXHR.responseText);
    		var message = response ? response.error.message.value : textStatus;
    		console.log(message);
		 });
		
	}	//	addTSRecord

Open in new window

0
I have a requirement to use one controller that accepts two posts.
I receive the following exception "Multiple actions were found that match the request"

I realize this not ideal and it would make sense to just have a second controller. However, that is not an option. How can I complete this?
0
Searching for the user ID (integer) in Zendesk... test user has actual  id=22335667888 but the command I send to search for her returns id=2.2335667888E10

What is the best way to sanely convert that back? Can I always just remove the . and the E10?
0
Hello,
My questions are not being posted?
Administrator; Why?
It appears that this question got posted, so I will actually ask a question.
I have an external monitor hooked up to my laptop.  I have the font setting on the monitor set.
When I open Ready API! 1.9.0 the fonts are very tiny and I do not find where or how to change the size.
I do not want to change the size or resolution of the monitor.
Thanks
0
Hello all,

What is the best way where I can hit a Rest Service URL I define where I would dynamically through a for container somehow pass an ID as the last part of the URL http://myserver.app/id/40 and as I loop through if I don't return a response for one of the calls I need to set a variable as error.

Thanks all
0
Free Tool: Port Scanner
LVL 9
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I am new to SQL Server but have been using MS Access for over 10 years.  This is my first application with a SQL backend and I want to take advantage of the SQL abilities, in this case Stored Procedures.

In my front end Access 2013 application I have payment inquiry screen.  At the top of the screen are possible filters, Muni (Long), LB (String), Payee(String), From Pay Date(ShortDate), Thru Pay Date(ShortDate).

The user must complete at least one of the filters then press the ‘Apply Filter ‘ button.  In prior application I have written, I then construct a Select statement based on the filters filled and use the constructed select as the recordset of the form  If multiple filters are selected the individual field selections are combined with an ‘Add’.  Here’s some example Access code to build a ‘Where’ condition behind one of these forms.
anyFilter = False
strFilter = " Where "
'
' Build filter
'
' Muni
If Nz(Me.txtMuni_Filter, 0) = 0 Then
Else
    If anyFilter Then
        strFilter = strFilter & " And [Muni] = " & Me.txtMuni_Filter
    Else
        anyFilter = True
        strFilter = strFilter & " [Muni] = " & Me.txtMuni_Filter
    End If
End If
' Lot Block
If Len(Trim(Nz(Me.txtLotBlock_Filter, ""))) = 0 Then
Else
    If anyFilter Then
        strFilter = strFilter & " And [LotBlock] Like " & Chr(34) & "%" & Trim(txtLotBlock_Filter) & "%" & Chr(34)
    Else
        anyFilter = True
        strFilter = strFilter & " [LotBlock] Like " & Chr(34) & "%" & 

Open in new window

0
I have a site with a NSA 240 and a TZ 200. The NSA has 12 VPN site to sites and the TZ has four. One of the tunnels stopped working and I have not been able to bring it back up. I have tried several types of configurations. The rest of the tunnels are ok. I deleted the vpn and reconfigured it again. This is what I get on the log. Since it was working before and I haven't make any changes I'm a little stumped.

 
19:37:25 Apr 26 406 Received packet retransmission. Drop duplicate packet 108.234.180.xxx, 500 192.168.1.64, 500 udp VPN Policy: M-
ain SY  
19:37:16 Apr 26 38 ICMP packet dropped due to Policy 108.234.180.xxx, X1 192.168.1.64 icmp  


Any ideas?
0
I'm trying to send a json string param to a post rest webapi method

Any assistance much appreciated


this doesn't work

var report = 2;
    var parameters = "{'report':'" + report + "'}";
   
    implementationworkqueueTable = $("#implementationworkqueueTable").DataTable({
        dom: 'Blfrtip',
        oSearch: { "bRegex": false, "bSmart": true },
        deferRender: true,
        bFilter: true,
        bSearchable: true,
        bProcessing: true,
        bRetrieve: true,
        bSortable: true,
        lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
        stripeClasses: [],
        ajax: {
            "url": "api/InfoHedge/IRequest",
            "async": true,
            "data": parameters,
            "dataSrc": function (json) {
                var data = JSON.parse(json);
                alert(json);
            },
            "datatype": "json",
            "contenttype": "application/json; charset=utf-8",
            "type": "POST"
        }
    });

Open in new window


This works

var report = 2;
    var parameters = "{'report':'" + report + "'}";

    $.ajax({
        type: "POST",
        async: true,
        url: "api/InfoHedge/IRequest",
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (result) {
            var data = JSON.parse(result);

            var test = JSON.stringify(data.Table);
            alert(test);
            //alert(result);
        }
    });

Open in new window

0
I am making a REST call with a filter.  I know that there is a field names Status with 26 items has Status = Completed.  When my filter looks like this"
$filter=Status eq 'Completed'  
I get back 26 items.

The list has 60 items total.

When my filter looks like this:
$filter=Status neq 'Completed'
I get nothing back.

Please advise.
0
I have an Outlook (2010) Macro that sends emails with certain keywords in them to the "Deleted Items" bin.  What I would like now is an Outlook macro that will move emails having certain key words (account, ssn, credit) to another folder and the rest to the "Deleted Items" bin. All these emails come from a defined account.

see the code that I am using right now.

Function UnwantedMessage(olkMsg As Outlook.MailItem) As Boolean
    'On the next line edit the keywords/phrases you want to filter out.  Use the | character to separate each word/phrase
    Const KEYWORDS = "Address change completed|Thank you for your interest in employment |Ad|Internet Explorer 8 Settings"
    Dim olkAtt As Outlook.Attachment, objRegEx As Object, colMatches As Object
    Set objRegEx = CreateObject("VBscript.RegExp")
    With objRegEx
        .IgnoreCase = False
        .Pattern = KEYWORDS
        .Global = True
    End With
    For Each olkAtt In olkMsg.Attachments
        If IsHiddenAttachment(olkAtt) Then
            Set colMatches = objRegEx.Execute(olkAtt.FileName)
            If colMatches.Count > 0 Then
                UnwantedMessage = True
                Exit For
            End If
        End If
    Next
    Set olkAtt = Nothing
    Set objRegEx = Nothing
    Set colMatches = Nothing
End Function

Open in new window

0
input maybe, "Primary","Spouse","Chidren","Chidren"
input mabye, "Primary","Spouse","Chilren"
(The input came from asp.net checkboxlist so it is dynamics)

Output maybe
Primary
Spouse
Primry+Spouse
Primary+Child (should occur when only one children is occurred)
Priamry+Chidren
Family

DtFamilyCombination's goal is to return one record/row only
Below is work, but I do not want how to continue for the rest of situations.
Please helps.


private DataTable DtFamilyCombination(Array selectedList)
        {
            DataTable dt = new DataTable();
            dt.Clear();
            dt.Columns.Add("Type", typeof(string));
            foreach (var item in selectedList)
            {
                string str = item.ToString();
                if(str=="Primary")
                {
                    dt.Rows.Add(str);
                    break;
                }               
            }
            return dt;
        }

Open in new window

0

REST

164

Solutions

339

Contributors

Representational state transfer (REST) is an architectural style that gives a coordinated set of constraints to the design of components in a distributed hypermedia system used to design networked applications. RESTful systems typically communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) that web browsers use to retrieve web pages and to send data to remote servers. REST interfaces with external systems using resources identified by Uniform Resource Identifier (URI) that can be operated upon using standard verbs.