spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » REST » Page 1
REST API and eager loading rested resources
I would go with the following REST-style URLs: GET /authors - to get list of all authors GET /authors/{authorId} - basic info about the concrete author in one request GET /authors/{authorId}/detailed - detailed info about the concrete author in one request Additionally, you could have the following methods to extract specific info about author: GET /authors/{authorId}/images - get all images

Categories : Rest

ADO .Net RESTful partial update
You can try and see if the service supports PATCH: Several applications extending the Hypertext Transfer Protocol (HTTP) require a feature to do partial resource modification. The existing HTTP PUT method only allows a complete replacement of a document. This proposal adds a new HTTP method, PATCH, to modify an existing HTTP resource. See also this page at The RESTful Co

Categories : Rest

Loopback.io and CouchDB connector
I would suggest playing with the API explorer to figure out your endpoints. Create a sample LoopBack project via slc loopback Create some models via slc loopback:model Start the app via slc run Browse to localhost:3000/explorer In there you can see all the endpoints that are automatically generated by LoopBack. Like if you click the GET endpoint for a model, it will show the query as GET /api/

Categories : Rest

ActiveMQ persistence issue while using REST
Topics do not support persistence without durable subscriptions, or one of the topic to queue solutions, such as virtual topics. However the REST API does not support durable subscriptions, so you are left with couple of options. If you require that multiple subscribers get a copy of the message, and ensure the message survives an outage, you can use Virtual Topics and/or Composite queues.

Categories : Rest

Optionally disable HATEOAS format in Spring Data Rest
The short answer is, you can't use spring-data-rest without hateoas. If you want to build your web service without hateoas, you'll have to write your own controllers (which can still use spring-data repositories). Quoting Oliver Gierke in this SO post: Actually my whole point is: the server is just doing decent REST. If that breaks the client, it's the client that needs to be fixed (tweak

Categories : Rest

How to save canvas as an image in Spring Rest webservice
Try this~ // jsp function saveCanvasImage(){ var imageData = myCanvas.toDataUrl(); $.ajax({ url:'/controller/path/saveCanvasImage', data:{imageBase64: imageData}, type: 'post', dataType: 'json', timeout: 10000, async: false, error: function(){ console.log("WOOPS"); }, success: function(res){ i

Categories : Rest

Operations in a "RESTful" API
I would do something like this: PUT api/slideshows/123/slides/26/position 22. Btw. it is interesting. You can do it 2 ways: every slide has a unique id, which does not depend on the order the id is the same as the order index (or position) - in this case you have to update the whole collection after every move, because the server maintains the resource state and not the client, so it will be mu

Categories : Rest

How to distinguish application state and resource state
Resource state is a state that needs to be persistent and survivable even after client disconnect/restart/session end/whatever. Application state should live on the client and should be supplied with each client request(if we are talking about REST architecture and planning to scale our application well). How to distinguish application state and resource state? It depends on the task your are w

Categories : Rest

what are REST,RESTFul, SOA and microservices in simple terms?
Disclaimer: most of this post is subjective. No attempt has been made here to strictly define anything, just trying to contextualize and give a global overview of the concepts and how they relate to each other. I thought I knew what REST/"RESTFul", restfulservices, webservices, SOA and microservices I'd say that all these terms fall into the umbrella of SOA. Web services is SOA using web-r

Categories : Rest

How to submit a change comment when making a change via the Version One API?
You can set the change comment for an API call by using the comment parameter in the URL of your HTTP POST. Using your example, the URL would be like this: /VersionOne/rest-1.v1/Data/Member?comment=Added+from+automation The XML payload would be just as you have it. Note that this also works for asset updates.

Categories : Rest

Auto generation of Sequence Numbers for nodes in Cypher REST API - Neo4J
You can use MERGE to mimic sequences: MERGE (s:Sequence {name:'mysequenceName'}) ON CREATE s.current = 0 ON MATCH s.current=s.current+1 WITH s.current as sequenceCounter MATCH .... <-- your statement continues here

Categories : Rest

Asterisk ARI create outbound call
When you create channel with ARI to address "/ari/channels" you MUST define "extension" or "application" parameters (read more https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Channels+REST+API#Asterisk12ChannelsRESTAPI-originate). Digitum make very unusable Python ari module and you may play with my module (now not implemented events) on https://github.com/vit1251/ari2.

Categories : Rest

Detecting if a TeamCity backup was successful using the API
The API is async , so in my backup script I loop to see when it finishes. #start backup $StartBackupUrl = "http://$TeamCityHostAndPort/httpAuth/app/rest/server/backup?includeConfigs=true&includeDatabase=true&includeBuildLogs=true&fileName=TeamCity_Backup_" $filename = Invoke-RestMethod -WebSession $TeamCitySession -Method Post -Uri $StartBackupUrl Write-Host "TeamCity backup on $file

Categories : Rest

Handling CRUD on child objects with RESTful
You're right. You have two different resources here. One is named Books and the other is named Catalogs. You must design two different URIs to address each one. So in this scenario, I'd create two different resources to handle this problem. The first resource would be named as /catalogs and you must build it to receive only the book ID (one or more) that someone wants to associate with this catalo

Categories : Rest

Does ST(State Transfer) in REST mean that state must be held by client?
The idea of honest REST service is to allow easy communication with it to any client, even to the client that is not in a web browser: it could be mobile or desktop application or anything else. So, each request to the service must provide all necessary information to process that request. Keeping the state on server would complicate the task, because clients will not control it. So, YES, ideall

Categories : Rest

Retrieving all(!) of the tweets of a user
just from the API documentation: https://dev.twitter.com/rest/reference/get/statuses/user_timeline Have you tried to send several requests setting different values for since_id and max_id? max_id: Returns results with an ID less than (that is, older than) or equal to the specified ID. since_id: Returns results with an ID greater than (that is, more recent than) the specified ID.

Categories : Rest

JAX-RS hide field just in specific methods
Remove the XmlTransient annotation, and before you send the password in the GET action, edit it like: user.setPassword("********"); or null, or any other value. Just do it outside your transaction, or you will update it in database.

Categories : Rest


Recently Add
how to send the ouput of wso2cep to REST api?
REST API and eager loading rested resources
ADO .Net RESTful partial update
Loopback.io and CouchDB connector
ActiveMQ persistence issue while using REST
Optionally disable HATEOAS format in Spring Data Rest
How to save canvas as an image in Spring Rest webservice
Operations in a "RESTful" API
How to distinguish application state and resource state
what are REST,RESTFul, SOA and microservices in simple terms?
How to submit a change comment when making a change via the Version One API?
Auto generation of Sequence Numbers for nodes in Cypher REST API - Neo4J
Asterisk ARI create outbound call
Detecting if a TeamCity backup was successful using the API
Handling CRUD on child objects with RESTful
Does ST(State Transfer) in REST mean that state must be held by client?
Retrieving all(!) of the tweets of a user
JAX-RS hide field just in specific methods
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.