restful-url

REST - Creating Nested Resources with single POST

﹥>﹥吖頭↗ 提交于 2019-12-21 13:02:52
问题 Thinking in a RESTful way, is it correct to use POST to create in a single call a resource and its sub-resource? In my application I have the resource /notices/{notice} and sub-resource /notices/{notice}/photos/{photo} . A {photo} can't exists without a {notice} , but a {notice} doesn't have necessarily photos. Normally, I have to do first a POST to create a notice, then another POST to add a photo. Now I want to allow the creation of a notice with a photo directly attached, enabling the

RESTful API URI Design

隐身守侯 提交于 2019-12-20 09:06:57
问题 I'm looking for some direction in regards to the URI design for a RESTful API. I'm going to have several nested linked resources and have currently designed my URI's similar to this post: Hierarchical RESTful URL design The following example isn't what I'm building but I think illustrates my situation well. (Assume that a show can only belong to one network). /networks [GET,POST] /networks/{network_id} [GET,PUT] /networks/{network_id}/shows [GET,POST] /networks/{network_id}/shows/{show_id}

How to access a huge JSON coming (from a spring RESTful Service) in a spring MVC app using RestTemplate

这一生的挚爱 提交于 2019-12-20 03:29:27
问题 My Spring RESTful web service is returning a JSON form of- [{"key1":"value1","key2":"value2","key3":"value3"},{"key4":"value4","key5":"value5","key6":"value6"}] Now when my spring MVC app, try to access it, to show in a JSP then Exception occurs saying- no suitable HttpMessageConverter found Please help me where I going wrong.Here is my code- Inside @Controller class of my spring MVC app calling the RESTful service //**com.songs.controllers.FrontSongController.java** </* author Rohit Tiwari *

Is it okay to use same resource name for both get and post rest api

江枫思渺然 提交于 2019-12-19 05:35:16
问题 Sometime back I developed a Restful service in Java with only 1 GET resource. It was accessed like this: GET http://localhost:8080/my-project/customers/transactions This GET request returns all the customer transactions. Now, I have another project request where they want to insert customer transactions in a different schema in same database. I thought instead of creating other service I could enhance this service since underlying database is same and it's about customer transactions. So, I

Is it okay to use same resource name for both get and post rest api

核能气质少年 提交于 2019-12-19 05:35:10
问题 Sometime back I developed a Restful service in Java with only 1 GET resource. It was accessed like this: GET http://localhost:8080/my-project/customers/transactions This GET request returns all the customer transactions. Now, I have another project request where they want to insert customer transactions in a different schema in same database. I thought instead of creating other service I could enhance this service since underlying database is same and it's about customer transactions. So, I

Unable to disable ssl verification in cURL

巧了我就是萌 提交于 2019-12-18 18:27:12
问题 I have exposed some ReSTFul web services on a corporate network [ Company's Internal Network]. I am trying to test those using curl on windows . The address of the GET request is something like this --> (http s on non standard port ) https://myCompanysNet:13432/something/something/1.0.0/ curl -H "Accept:application/xml" --user username:password "https://myCompanysNet:13432/something/something/1.0.0/" And I have added option insecure in curlrc conf. file But instead of getting the required

Unable to disable ssl verification in cURL

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 18:27:10
问题 I have exposed some ReSTFul web services on a corporate network [ Company's Internal Network]. I am trying to test those using curl on windows . The address of the GET request is something like this --> (http s on non standard port ) https://myCompanysNet:13432/something/something/1.0.0/ curl -H "Accept:application/xml" --user username:password "https://myCompanysNet:13432/something/something/1.0.0/" And I have added option insecure in curlrc conf. file But instead of getting the required

URL design for an API

放肆的年华 提交于 2019-12-17 18:22:40
问题 I'm working on a private apis for our backend. I have collections that have associations. Each collection can be requested, paginated, you can also ask for the associations and paginate this associations. We're not sure about which URL design to use ... we're thinking about : /users.json?per_page=10&association=parts,auditions&parts_per_page=5&auditions_per_page=5 /users.json?per_page=10&association[]=parts&association[]=auditions&parts_per_page=5&auditions_per_page=10 /users.json?per_page=10

How to access the services from RESTful API in my angularjs page?

余生长醉 提交于 2019-12-17 14:59:40
问题 I am very new to angularJS. I am searching for accessing services from RESTful API, but I didn't get any idea. How can I do that? 回答1: Option 1: $http service AngularJS provides the $http service that does exactly what you want: Sending AJAX requests to web services and receiving data from them, using JSON (which is perfectly for talking to REST services). To give an example (taken from the AngularJS documentation and slightly adapted): $http({ method: 'GET', url: '/foo' }). success(function

How to save JSON from url and update the saved file from url after fixed interval say 5 min

淺唱寂寞╮ 提交于 2019-12-17 14:30:31
问题 I want to save a JSON file from url locally in my app and also since JSON file is getting updated every minutes so i want to update my local file with updated JSON on url after fixed interval of time in backend(without affecting frontend) 回答1: One way is to use shared preferences to store JSON string and update that as and when required. To store data: SharedPreferences settings = getApplicationContext().getSharedPreferences("PREF_NAME", MODE_PRIVATE); SharedPreferences.Editor editor =