w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » REST » Page 1
REST: GET filtering convention
I think it depends rather state is a resource or not. REST conventions are Controller/Resource/Sub -Resource, for example: Books/Comics/SuperMan/FirstEditon rather than Books/Comics/SuperMan?edition=FirstEdition More readable, and indicates that FirstEdition is a resource rather than a state.

Categories : Rest

handling PreFlight requests to a security-constrained RestEasy powered rest api 2.x
After doing further research, I found that it was indeed auth-constrained RestEasy cover all url pattern /* was causing this issue. I did an override of security-constraint for options with http-method (ref https://docs.oracle.com/cd/E19798-01/821-1841/bncbk/index.html) with url-pattern /*. This solved the problem. I hope this will be useful to others.

Categories : Rest

How to get article with comments using Drupal 8 REST?
Create a new View with the following settings: Provide a REST export, and add a path. Make sure that Format is set to Serializer and Accepted request format is set to json Add a filter for Content: Type (= [your format]) Add in Fields a field for Content: Comments

Categories : Rest

laravel 4 restful controllers manually
If you want to make it RESTful, the simplest way in laravel is to do Route::resource('user', 'UserController), which automatically gives you the routes shown on the laravel web page. However, if you are trying to look up the friends RESTfully you would want to make a /friends/ resource, and then register it as Route::resource('friends', 'FriendController'). For more on the relationships/friends

Categories : Rest

URL Builder/Query builder in Go
There's already url.URL that handles that kind of things for you. For http handlers (incoming requests) it's a part of http.Request (access it with req.URL.Query()). A very good example from the official docs: u, err := url.Parse("http://bing.com/search?q=dotnet") if err != nil { log.Fatal(err) } u.Scheme = "https" u.Host = "google.com" q := u.Query() q.Set("q", "golang") u.RawQuery = q.Enc

Categories : Rest

Appropriate response for job result in REST API
When doing a GET on that resource after it the compilation is finished, I'd return 200 OK along with a response body indicating the success or failure of the compilation. Here I'll use JSON as the media type. For instance, when compilation was successful you would have this response: HTTP/1.1 200 OK { "status" : "success" } and if the compilation failed you would perhaps include the reason

Categories : Rest

Invalid Signature with telesign call REST API
Looking over their documentation on Constructing the CanonicalizedPOSTVariables Element it mentions that the POST body must match the string used when constructing the signature (emphasis mine): ... when you construct the signature string, you must use the body of the POST request exactly as it is delivered to the service. By default, cfhttpparam url encodes any formField values. Since you

Categories : Rest

Getting Tornado to return HTTP 400 on all unused URLs
Put a catch-all URL route at the end of your application's list of routes. Make a handler for that catch-all route that raises HTTPError(400) for GET and POST requests. Here's an example: import tornado.ioloop import tornado.web class GetHandler(tornado.web.RequestHandler): def get(self): self.write("GetHandler ") class PostHandler(tornado.web.RequestHandler): def post(self):

Categories : Rest

Need help in REST ASSURED
Change the body of your first example to: body( "[0].name", equalTo("Russia") ) That is because the JSON response from the server is not an object, but an array, and you have to query for the first object ([0]), then the name (.name).

Categories : Rest

How to implement polling of a REST api in Bacon.js?
You could add .take(1) to the succStream to only take 1 value. The polling stops, as the stream has no more subscribers. Check out this jsfiddle. // Poll job status code until it's successful var succStream = Bacon.interval(pollInterval) .flatMapLatest(function (v) { return checkStatus(); }) .filter(function(v) { return v === true; }); succStream.take(1).onValue(function (_) { log("succe

Categories : Rest

404 Not Found or Bad Request?
404 is your best response. According the HTTP RFC, http://www.ietf.org/rfc/rfc2616.txt, a 400 Bad Request means: The request could not be understood by the server due to malformed syntax. Whereas, a 404 states: The server has not found anything matching the Request-URI. The entire URI is your resource identifier, and you're not finding a matching resource for that particular identifie

Categories : Rest

Sencha Touch: How to build a restful proxy url syntax?
Try the following: window.serverUrl = "192.168.1.XX" var service = "login.php" var dataTosend: { username:"xx", password: "yy" } var methode:"POST" / "GET" this.service(service,methode,dataTosend,onSucessFunction,onFailureFunction); onSucessFunction: function(res) { alert("onSucessFunction"): }, onFailureFunction: function(res) { alert("onFailureFunction"): }, service: functio

Categories : Rest

REST API: An enquiry about the IDs
Yes, it can be a String. As long as it is unique and it helps you to identify the underlying resource, it can be whatever you want. It is often a good choice to provide both options. Let's say you got an API for persons, you could GET /users/133/ and GET /users/jondoe point to the same resource.

Categories : Rest

float in REST-API call
I would just do something simple like convert the decimal point to an underscore :) It's less messy than URL encoding. Do you have to support scientific notation (ex 1.5e+20)? In that case you'll have to deal with + and -. (though - doesn't need encoding)

Categories : Rest

Spring Rest MultiModule Project has ClassCastException in requestMappingHandlerMapping()
Okay I got the problem, but I really don't know why this is a problem or is it a spring bug. I am using a module for Business-Method Logging, what I have centralized as aspect. This works with the modules backend and business, it just start that exception behavior when I use spring-mvc with spring-boot. As you seen above my module backend has annotation @ImportResource("classpath*:META-INF/sprin

Categories : Rest

Empty response while making a GET http request to the localhost server using Go
There are several things that you need to change to make it work. The JSON you pasted is not valid (check on it with a linter). Once you are sure that what is coming in is valid JSON, the go code needs to be modified as follows: Fields need to be "decorated" with options that tell the JSON parser what the field names are The Payload struct contains a slice of Data based on the JSON description

Categories : Rest

Can I use HTTP to access system directories?
You cannot use the absolute path, you must use a path which is relative to the HTTP server's document root. For example, if your server is using /home/abc/ as the document root you would use the URL http://10.0.x.xx:3000/Desktop/hello.json

Categories : Rest

Can a "full-REST-SPA" architecture improve performances and network load over classic/template architecture?
After posting this question on google+ ( without additions "for dummies" ) they understood my request and i've found also a reasonable answer that is not subjective at all ( last comment): https://plus.google.com/u/0/104873054042278826576/posts/gAhDryGxE3h Note for the community: i know that probably this answer will be moderated/deleted, but i feel compelled to say that the stackoverflow syste

Categories : Rest

How to change http status codes in Strongloop Loopback
In your call to remoteMethod you can add a function to the response directly. This is accomplished with the rest.after option: function responseStatus(status) { return function(context, callback) { var result = context.result; if(testResult(result)) { // testResult is some method for checking that you have the correct return data context.res.statusCode = status; } return c

Categories : Rest

Download file from SharePoint
Are you using the v1 of the API? From your endpoint it seems like you're using preview (v1 was released 2 weeks ago; we might still have outdated references on our documentation pages, please let us know if you come across any) Example: GET https://{tenant}.sharepoint.com/{site-path}/_api/v1.0/Files/{file-id}/content This is the URL of the documentation section that shows you how to download a

Categories : Rest

Verbs in a RESTFUL (hypermedia) API
I'd be fine with that, we are using a very similar setup for order management. However, another possibility would be passing an action parameter, such as: https://api.site.com/orders/{orderId}/?action=accept https://api.site.com/orders/{orderId}/?action=reject ... The general idea of REST is to have resources (such as order or customer). What you want is more of a RPC semantics, but there is n

Categories : Rest

REST: URI and method to get resource statistics
How do you GET a single tournament? If you use GET /tournaments/1234 where 1234 is the ID of one tournament, I think is not a good idea to use GET /tournaments/stats to get the statistics. /tournaments is a collection resource and stats is not the ID of one tornament in this collection. So I'd use a different resource, for example GET /tournamentsstats which could then be filtered /tou

Categories : Rest

Caching in a Service oriented architecture
I have seen the Option 1: Client -> RESTful Service -> Cache Server -> Database working very well. Pros IMHO are that you are able to operate wtih and use this layer in a way allowing you to "free" part of the load on the DB. Assuming that your end-users can have a lot of similar requests and after all the Client can decide what storage to spare for caching. Also how often to clear it.

Categories : Rest

Get vs Post Performance
POST is more secure than GET for a couple of reasons. GET parameters are passed via URL. This means that parameters are stored in server logs, and browser history. When using GET, it makes it very easy to alter the data being submitted the the server as well, as it is right there in the address bar to play with. POST just puts the information in a different place (request message body) than GET

Categories : Rest

SwaggerSpringMvcPlugin not working on Spring MVC
I was probably stumbling upon the following issue, "No matching bean was found for auto-wiring" for RequestMappingHandlerMapping: http://forum.spring.io/forum/spring-projects/web/112154-unable-to-autowire-requestmappinghandlermapping-in-controller In the mean while I have switched to Java based configuration to replace my XML. This solved the autowire issue as well. Hereby my solution for other'

Categories : Rest

Should the rest services use only 4 http methods?
a) don't look at RFC 2616. It's obsolete. b) the list of registered HTTP methods is over here: http://www.iana.org/assignments/http-methods/http-methods.xhtml (with pointers to the specifications)

Categories : Rest

Play Framework 2.3 OAUTH 2 Java Provider
The master branch of securesocial have support for play 2.3. Here is the project website: http://securesocial.ws/ . There isn't a stable version right now.

Categories : Rest

REST Design - PATCH for a specific update
I would perform the PATCH against the URI of the object being patched: PATCH v1/devices/EF-55-33-44-54-61 There is no convention saying that the PATCH method in your Web API Controller has to allow patching for all properties on the device object. If you only support an update to that one property, that is OK. While the longer JSON above seems a bit excessive, it also means that if something c

Categories : Rest

Upload in Alfresco Repository
1) I can see a set of folders, but how are them managed by Alfresco? As far as i know, those folders doesn't really exists physically, they are virtual. How does Alfresco manage the folders structure and files? Alfresco is an implementation of the Java Content Repository (JCR), this means that all the contents are managed using a logic structure similar to a graph of nodes. Storing and ma

Categories : Rest

RESTful interface for ECG/EEG sensor data in haskell
Okay, let's go through this. REST is not necessarily a bad idea but it has a lot of features which you may not need. For example, there are REST verbs not just for retrieval, but also updating, deleting, and creating resources. If those functions are important (e.g. you need to send certain control data to the EEG controller) then REST will be nice. If you just want fast access to the stream of d

Categories : Rest

Get rest data with some conditions in Yii2
You can achieve this by overriding users action or creating new action in your REST controller: public function actionActiveUsers(){ return User::find()->where(['active' => 1])->all(); } Now, you can get active users via user/activeUsers URL.

Categories : Rest

Backend service with SOAP binding required to expose as a RESTful - WSO2 ESB
If you need to expose a SOAP Service and REST (POX or JSON), you can do it using ESB. You can create a API in ESB and does the mapping between JSON or POX to SOAP. There are samples available in the ESB documentation. Please check from here. You do not need a API manager, if you just need to expose some REST API. You can do it using ESB as well and you do not need to use API Manager.

Categories : Rest

Use CSV values in JMeter as request path
The CSV should be as per the format mentioned in the image attached. Refer to the link on how to use CSV in Jmeter: http://ivetetecedor.com/how-to-use-a-csv-file-with-jmeter/ Thread Group Settings No. of threads: 1 Ramp-up period: 1 Loop Count: 4 Hope this will help.

Categories : Rest

Does twitter rest api give only a sample of the data?
Depending on the endpoint the number of tweets you can retrieve varies. In the case of tweets from a user you should use GET statuses/user_timeline. According to the documentation of this endpoint: This method can only return up to 3,200 of a user’s most recent Tweets. Native retweets of other statuses by the user is included in this total, regardless of whether include_rts is set to false

Categories : Rest

Calling REST API from the same server
If possible, the actual best thing to do would be to call the API code directly through Python without going through HTTP and REST. This would avoid the overhead and possible failure points of a HTTP request. I'm not familiar with flask-restful so I don't know how easy this might be. The answer in "Calling flask restful API resource methods" seems to suggest just extracting the common code from th

Categories : Rest

RESTful way to accept a choice
Depends on the nature of the Acceptance. If Acceptance is a simple attribute of an offer, I would POST the Offer with the Acceptance set to True. If the Acceptance is more complex and therefore a resource in its own right, I would PUT an Acceptance into the offer (PUT /requests/123/offers/acceptance). If there exists such a thing as a rejection, or a request for offer clarification, I might con

Categories : Rest

Directly connecting two Arduino Yun boards to each other
I found another way to connect two Arduino Yun boards directly, or as close to "directly" as it probably gets. The REST API was not the right way to go. So this is for anyone who might encounter the same "problem": After some research I came across "Spacebrew". It's based on "websockets" and requires a server to connect the boards to each other, but it is very flexible. It's also fairly easy to s

Categories : Rest

SLIM Framework - How to make an Access Control List with SLIM?
I'm searching the best way to implement resource ACL using SLIM also. I think that route access control isn't good thing. In REST API resources are identified by a dynamic URL, eg "/member/:id". I think that permissions control on a route does not provide any security check on single resource; if user have full access to [/member/1] could always perform a DELETE on [/member/2], because the main r

Categories : Rest

jersey 2 restful custom application null pointer exception
Servlet tag must have , Servlet Name Servlet Class Init parameters Something like this: XML FILE <?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">

Categories : Rest




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.