Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x

REST

211

Solutions

431

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

Our mobile app is experiencing a strange behavior in a place where they have WiFi. If the app uses THAT WiFi there's an HTTP POST request (to our API) that gets the response content truncated randomly (not always truncated, and if truncated not always at the same place).

I made several tests at that place (using the app and also Postman) and found that on mobile data the response always comes OK, but when connecting with that WiFi the response sometimes gets truncated. Also, I saw that other API requests get the response correctly, even when the content length is 10 times bigger (I thought that maybe the response was too big, but we're talking about just 10Kb).

The failing request is a regular POST request sent to a REST API made with Dropwizard. The request gets processed correctly on the server, which returns status 200 and the content. The client gets the status 200 but the content is truncated, so the whole operation can't be finished.

I wonder if there's something wrong with that WiFi, or if this kind of response errors must be expected and dealt by our application. I haven't seen this behavior before.
0
Free Tool: Path Explorer
LVL 11
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

I am building a solution that will display KPI information on a set of large TV screens for our warehouse and we use Netsuite for our ERP. My netsuite developer that we have in house can build a REST API in netsuite that uses Token based authentication to expose the data that i need but i am having trouble finding information on how to connect to this API.
All help is much appreciated.
Regards Joel
0
I'm trying to run a Credit Report using Trans Union REST API with C# code. I installed a digital certificate on my machine today. I think that went OK. But I'm not sure if I need to open our firewall to certain IP address, or if I need to list my IP address with the certificate. And, I'm also not sure what the URI is for the API. The only URI I see for testing is https://netaccess-test.transunion.com. But, I would expect that the API would be a bit longer.

For this question, if you use the Trans Union API, any help that moves me in the right direction would get at least some credit as an answer.
0
A customer wants to have users register, manage profile, reset password and this is possible using B2C.

What I'd like to know is, whether it is possible to integrate all this functionality in an existing web application and perform REST APIs to Azure B2C?
0
Hi,

I am in the process of building a call to a rest service.  I am correctly making the calls to the service etc, but I am having a slight issue with pulling specific data out.

Given the below response:

"{"nextpageuri":null,
"previouspageuri":null,
"sms_messages":
[{"created":"Fri, 08 Dec 2017 03:34:55 +0000",
"id":"cf4083fd852758af8bca5cffb77771d7",
"from":"0419000000","destination":"61417000000",
"message":"SAMPLE MSG",
"uri":"\/2016-11-30\/sms\/cf4083fd852758af8bca5cffb77771d7",
"receipts":{"delivered":"Fri, 08 Dec 2017 03:34:58 +0000"}}],"message":"Response follows","api_version":"2016-11-30","status":200,"uri":"\/2016-11-30\/sms\/cf4083fd852758af8bca5cffb77771d7"}"

Open in new window


This is what I am attempting to use to seperate out the receipts:
  // MAKE AN OBJECT
$Callresult = json_decode($response);
echo "attempt 1:".$response->sms_messages[0]->receipts;

But I keep getting an error of:
Notice:  Trying to get property of non-object

and if I try:
echo "attempt 1:".$response->sms_messages[0]->receipts;
i get:
Catchable fatal error:  Object of class stdClass could not be converted to string

if anyone could help it would be most appreciated!!!
0
When I shot down my computer (or restart) I always get this error message:
Screenshotand the address is the same.

1) Can I rest assure that there IS a faulty memory card?
    IF SO: Is there any smart way to find out which of the 4, or is it just to take out on-at-the-time and see what happens.

2) Can it be something else that just LOOKS like a hard error?

Thanx for helping.
Knud, Denmark
Memory-could-not-be-written-1.jpeg
0
Hello

I would like to to DO CRUD operation using Lotus Domino REST SERVICE ( Notes 9, not using xpages ), any body has idea on this ?


Thanks
0
http://localhost:8080/kie-server/services/rest/server/containers/mybpmcontainer
The above url works and tells me the container details :
"container-id": "mybpmcontainer",
            "release-id": {
                "version": "1.0.1",
                "group-id": "com.acme.migration",
                "artifact-id": "vmmigration"
            },
            "resolved-release-id": {
                "version": "1.0.1",
                "group-id": "com.acme.migration",
                "artifact-id": "vmmigration"
            }

However, the below url doesnt show the process deployed :
http://localhost:8080/kie-server/services/rest/server/queries/processes/definitions

Output :
{
    "processes": []
}

I need assistance around the endpoints and how to invoke jbpm process through rest api.
0
Hi,
I want to insert custom columns which is not available under csv using control file.

how to pass that custom values to control file and insert into database when control file triggers with csv data.

we have 10 columns in table but csv have only 8 columns rest of the two columns are created based on the file(csv) data or name of csv.

Please guide me.
Thanks,
0
In jquery, is it possible to find element then get the rest of the nodes(outside of original element)?
E.g.

If i pass you BondName = abc and if it is found, then output me everything within <additionalInformation>?

 <Surety>
  <SuretyLine>
   
    <Commercial>
      <Bond>
		<General Information>
		<BondName>abc</BondName>
   		</General Information>
		<AddtionalInformation>
          		<div class="col-lg-12">
           		 <Input Type="text" Name="additionalInfo_licenseNo" ID="additionalInfo_licenseNo" Onchange="fnSaveSingleData(this.name,'1')" Placeholder="Enter License No." 				Class="form-control" Title="License is required!" PrefillValue="No" Required="" />
          		</div>

        	</AddtionalInformation>
      </Bond>
       <Bond>
	<General Information>
		<BondName>xyz</BondName>
   	</General Information>
	<AddtionalInformation>
          <div class="col-lg-12">
            <Input Type="text" Name="additionalInfo_licenseNo" ID="additionalInfo_licenseNo" Onchange="fnSaveSingleData(this.name,'1')" Placeholder="Enter License No." Class="form-control" 		Title="License is required!" PrefillValue="No" Required="" />
          </div>
        </AddtionalInformation>
      </Bond>
    </Commercial>
  </SuretyLine>
</Surety>

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!

Haven't been here in a while.

I am trying to setup the highlight selected record in a continuous form.  Each record has a [delete] button and a [Appt_ID] box.

There is a txtActiveRecord box in the header.  The Delete_OnClick event sets "Me.txtActiveRecord = Me.txtAppt_ID" as the first item in the procedure.  CF then kicks in on "expression is: [txtAppt_ID]=[txtActiveRecord]"  and sets one of the controls to a particular colour. The rest of the On_Click event asks the user "are you sure" etc, and if clicked "No", it all returns to normal.

This works perfectly, EXCEPT the CF doesn't kick in until after the procedure is completed.  i.e. too late.  

However, when I step through the event line by line, the CF kicks in right on cue.  i.e. a the "Me.txtActiveRecord = Me.txtAppt_ID" line.

Where have I gone wrong?

Cheers,
Brodie
0
hello
currently i am returning like below from my asp.net wb api
{
  "emplyoees": [
            {
                "empid": "3301",
                "empname": "John"
                },
 {
                "empid": "3991",
                "empname": "Marty"
                }
                ]
            }
        

Open in new window

i do not want to return key name "employees".
i want some thing like this:
{
   [
            {
                "empid": "3301",
                "empname": "John"
                },
            {
                "empid": "3991",
                "empname": "Marty"
                }
            ]
            }

Open in new window

here is my model classes
 public class EmployeesResponse
    {


      public   Employee[] Employees;
     }
 public class Employee
    {
        public string empid{ get; set; }
        public string empname{ get; set; }
}

Open in new window

0
Hello guys,

I'm designing a letterhead, i want the first page to have a design while the rest of the document to have a different design (Different header, different margins) all works well so far, my only issue is that i want to be able to paste a document into this letterhead, and the first page will have different layout than the rest of the pages.  

I've added a "section break ( continuous)" but when i paste my documents, the rest of the pages change to the design its supposed to change to but doesn't keep the margin needed, and that's because all the text comes before the "section break" i've added

Is there a chance to lock that section Break to the first page only and the extra text goes to the second page and adapt to its style.

Thank you
BEN
0
Currently I pull Goformz data using Excel VBA code which looks like the code below which works fine.

' Get Rest API Data from Goformz
Dim strUserName As String
Dim strPassword As String

strUserName = ""
strPassword = ""

Dim http As Object, JSON As Object, i As Integer
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "GET", "https://api.goformz.com/v2/formz?" & "status=draft" & "&filter=lastupdateddate%20gt%20" & Sheets("Values").Range("B7") & "%20and%20lastupdateddate%20lt%20" & Sheets("Values").Range("B8") & "&pagesize=" & Sheets("Draft Forms").DraftFormsComboBox1.value & "&pagenumber=" & Sheets("Values").Range("PageNumber").value & "&sort=lastupdateddate%20desc", False
http.setRequestHeader "Authorization", "Basic " & Base64Encode(strUserName & ":" & strPassword)
http.send
Set JSON = ParseJson(http.responseText)
i = 5
For Each Item In JSON
Sheets("Draft Forms").Cells(i, 1).value = Item("status")("status")
Sheets("Draft Forms").Cells(i, 2).value = Format(DateAdd("h", 11, Replace(Left(Item("lastUpdateDate"), 19), "T", " ")), "dd/mm/yyyy hh:mm:ssam/pm")
Sheets("Draft Forms").Cells(i, 3).value = Item("templateId")
Sheets("Draft Forms").Cells(i, 4).value = Item("templateUrl")
Sheets("Draft Forms").Cells(i, 5).value = Item("name")
Sheets("Draft Forms").Cells(i, 6).value = Item("url")
Sheets("Draft Forms").Cells(i, 7).value = Item("assignment")("url")
i = i + 1
Next
     
Sheets("Draft Forms").Range("A4").value = "Status"
Sheets("Draft Forms").Range("B4").value = 

Open in new window

0
Dear All

I am using WebClient.DownloadFile() to download  a text(*.txt) file from server. It was working fine in all systems since years but suddenly in two systems it started giving issues though in rest of the systems its working fine.
Issue is its downloading an empty file from server and getting hang.

Please suggest what could be the reason. Below is the line of code I am using to download the file.

                           using (WebClient wc = new WebClient())
                            {
                                try
                                {
                                    wc.Credentials = System.Net.CredentialCache.DefaultCredentials;
                                    wc.Proxy = null;
                                    wc.DownloadFile(ServerURL + ServerFileName, CurrentDir + ServerFileName);
                                    wc.Dispose();
                                    
                                }
                                catch (Exception ex)
                                {
                                    MessageBox.Show(ServerURL + ServerFileName+Environment.NewLine+ex.ToString());
                                }
                           }

Open in new window


Thanks in advance.
0
I have been teaching a colleague how to create org charts on our own machines. When showing her how to rearrange subordinates,  each time she selects a subordinate pattern with the connectors on the left hand side 2 things happen:
1. the 1st subordinate does not arrange as the rest it's arrow is always bent and forms a different pattern into the manager
2. the distance from the connectors to the shapes is very large
However if she selects any patterns with the connectors on the right of the shapes she gets what I get, and what I expect, uniformity and a tighter space.
We are both using 2016. Please advise. This is her first introduction to Visio so her software is straight out of the box so to speak.
Any ideas gratefully accepted
0
I'm trying to implement Rest API for BFM(BargainFindermax) in my project where SOAP calls are already implemented and working. Since Soap does not provide pagination options, I was trying to implement the same flight search functionality with REST "BFM" API.

After integrating the Rest calls through javascript http.post request, Rest calls are working but the returned results in REST "BFM" call are fewer than SOAP "BFM" call. Fare prices returned in REST call are expensive compared to soap results as well. The request body of REST call is exactly same as SOAP i.e. Cabin type, passenger details, origin/destination information, currency etc. are all forming just as it was in previously implemented SOAP call. REST Call does not seem to return any record against "SisterOriginMilage.Number" either.

For some reason, Rest BFM returns different, fewer and costly Itinerary results than SOAP BFM. Any idea what could be the reason for these different results? Any help would be much appreciated.
0

Below is my code.
Web-sphere context path is set to simple slash /.

xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
 version="3.0">
 <servlet>
    <servlet-name>RestServlet</servlet-name>
    <servlet-class>javax.ws.rs.core.Application</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>RestServlet</servlet-name>
    <url-pattern>/users/*</url-pattern>
</servlet-mapping>
</web-app>

Open in new window



appln

package com.ibm.jaxrs.sample;

import java.util.HashSet;
import java.util.Set;

import javax.json.JsonWriter;
import javax.ws.rs.ApplicationPath;

@ApplicationPath("/users")
public class HelloWorldAppConfig extends javax.ws.rs.core.Application {
	   
	   public Set<Class<?>> getClasses() {
	      HashSet<Class<?>> set = new HashSet<Class<?>>();
	      set.add(HelloWorldResource.class);
	      System.out.println("Completed application getclasses");
	      return set;
	   }

}

Open in new window



resource

package com.ibm.jaxrs.sample;

import javax.ws.rs.core.*;
import javax.ws.rs.*;
import javax.servlet.http.HttpServletRequest;

import javax.ws.rs.core.Application;

@javax.ws.rs.Path("/show")
public class HelloWorldResource {

	private static final String LINK_SELF = "self";
	public HelloWorldResource() {
		// TODO Auto-generated constructor stub
    	System.out.println("Got inside constructor");
	}
	
	@GET
	@POST
    @Produces(MediaType.TEXT_PLAIN)
	@Path("/show")
    public Response getAll(@Context UriInfo uriInfo) {
		System.out.println("Completed application getsingleton");
        return Response.ok("Hello").build();
    }//@Produces( MediaType.APPLICATION_JSON )
	
 }

Open in new window



included jars in WEB-INF\lib foler


com.ibm.jaxrs2.0.thinclient_9.0.jar
com.ibm.jaxws.thinclient_9.0.jar
com.ibm.ws.ejb.portable_9.0.jar
com.ibm.ws.ejb.thinclient_9.0.jar
com.ibm.ws.jaxrs20.tools.jar
cxf-rt-frontend-jaxrs-3.1.12.jar
cxf-rt-rs-client-3.1.12.jar
cxf-rt-rs-extension-providers-3.1.12.jar
cxf-rt-rs-extension-search-3.1.12.jar
cxf-rt-rs-json-basic-3.1.12.jar
javax.ws.rs-api-2.0.jar

Open in new window

0
I dont want to re-invent the wheel and build a new WCF or Rest webservice. Please advise, how can I find out if the service I need has already been created by someone? I would love to be able to re-use that WCF/Rest service.

Example: I need a service that would convert currencies.

Thanks,
Ricky
0
Concerto Cloud for Software Providers & ISVs
LVL 5
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

I have a web part page displaying 5 web parts. Four of the web parts (Efforts, Phases, Capture Points & Areas) are "provider" web parts, and come from lists that are the sources of 4 lookup columns in the 5th "consumer" web part (Lessons Learned).

The provider web parts are displaying the Title column from the lists.

The Using Javascript/jQuery, I "connected" the 4 provider web parts to the consumer web part, such that when you click on a Title column value, the consumer web part is filtered to show only those records that have the clicked value in the relevant metadata column.

All that is working very nicely.

Now, my requirement is to go one step further, and display the number of items that will be displayed if you click on a Title column value in any of the 4 web parts. If there are none, a "0" should be displayed.

I've constructed a lists service query that successfully returns the number of items that exist for a given, hard-coded, metadata value:
[SiteURL]/_vti_bin/listdata.svc/[ListName]/$count?&$filter=Effort/Title eq 'AAA'

So, the goal is to display such an item count beside the corresponding provider web part value, such as:
Efforts web part:
AAA (10) //assuming there are 10 items in the consumer web part tagged with Effort 'AAA'

Now, I'm bumping up against the current limit of my abilities.

I know that I need code (javascript, rest, ajax, json) for each provider web part with looping to cycle through all of the TD cells that have …
0
I'm trying to implement a restful architecture using .NET Core based on HATEOAS.

For that, I would be using an include parameter with a list in the GET requests so as to include the entities related to the parent.

For example, if I want to get a master (master/details) with the related client I would perform the following GET request:

GET http://api.com/master/id=1?include=Client

Open in new window

If the include clause is not there, the related client in the master will only show the link to get it.

The will happen with every related entity.

What I'm trying to find out is the best way to implement this in my base resource's class.

The solution I applied is to use a base class using generics:

public class InstanceResource<T> where T : BaseResource
{
    public string Href { get; set; }

    public string ClassName { get; set; }

    [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
    public T Object { get; set; }
}

Open in new window

Using this, I will have a Master with a InstanceResource related to it.

The object property of InstanceResource<Client> is the actual Client object. If Client is not included in the Include clause of the GET request, the object will be null and it will only show Href and ClassName.

GET http://api.com/master/id=1?include=Client
{
  "object": {
    "client": {
      "object": {
        "name": "JOHN DOE"
      },
      "href": "http://api.com/client/1",
      "className": "Client"
    },
    "details": {
      "href": "http://api.com/details/masterId=1",
      "className": "Collection<Detail>"
    }
  },
  "href": "http://api.com/master/1",
  "className": "Master"
}

Open in new window

Not included Client:

GET http://api.com/master/id=1

{
  "object": {
    "client": {
      "href": "http://api.com/client/1",
      "className": "Client"
    },
    "details": {
      "href": "http://api.com/details/masterId=1",
      "className": "Collection<Detail>"
    }
  },
  "href": "http://api.com/master/1",
  "className": "Master"
}

Open in new window

As you can see, this approach uses a container class to represent the resource. What I need to know if this solution has any disadvantage.

I saw other solutions where all the properties of the Object are at the same level that Href. Something like this:


Open in new window

0
I need to create a set of InfoPath forms and upload them with updated data to a document library.  I have put together some JavaScript which accomplishes this, but the upload of the document (InfoPath doc) is async and the code works fine when I run it in the debugger, but if I run the loop with no breakpoints, the browser hangs on the create/upload of the file.

I am not sure if it is that the function is async or that it appears to be CSOM whereas all my other code is using REST.  

Any help/ideas on this would be greatly appreciated.
0
Hi,

We are developing code in order to do requests to webservices. I am looking  for online webservices that I can use in order to test the next two kind of requests:
- a PUT request
- a request with a HttpHeader

Both SOAP and REST requests.

Anyone a idea for an online application I can use?

Regards,

Arne
0
For two years our vb.net sync app has been running quite successfully hosted on Azure. It gathers recent Db updates and additions from a SQL Db and transposes them on a schedule into the MySQL Db behind a Wordpress site.

The only problem comes when there are two many records to update/add. Then it is prone to either fail or abort in Azure. This happens typically when there are over 500 records to process and the program running time exceeds an hour or two.  We have worked with the Azure team extensively to try and prevent this, but it keeps happening.

We would like to experiment working with the Wordpress REST Api therefore, to see whether time is saved, and efficiency is improved, over the app's current direct SQL calls to the MySQL Db.

The thing is, I'm struggling to find any documentation about how to incorporate the WP REST Api calls in a VB.net application. Does anyone have any examples of how this should be done?

Thank you
0
Dear Sirs,
I have a web app rendering html and exposing at the same time some REST end points.
I have 2 two classes annotated with @ControllerAdvice:
1) A Class will manage all the errors generated on the web side of the application, and redirects to an Error view page
2) The other Class will manage all the errors generated on the REST side of the application and returns an ResponsEntity<Object>

I have some custom exceptions such as NotFoundException, AccessDeniedException, etc.. And there is a generic ExceptionHandler for the Class Exception.class in both the 2 @ControllerAdvice Classes: 1 for web side exception and 1  for REST side exception.

The confusion  I am seeing is that when the generic exception occurs, while I am consuming the REST end points, I will get an HTML error view instead of a Jackson string representing the ResponseEntity<Object> and vice-versa.

How can I handle this. Make @ControllerAdvice Class 1 only look at exceptions generated by all the classes annotated with @Controller, and @ControllerAdvice Class 2 only look at exceptions generated by all the classes annotated with @RestController.


Thanks a in advance
0

REST

211

Solutions

431

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.

Top Experts In
REST
<
Monthly
>