restful-url

how to parse huge JSON data froma url or restful service in android?without GSON

不想你离开。 提交于 2019-12-04 19:31:08
i have a Rest ful service,.. and i am getting a JSON data like,.. { "returnCode": "success", "RecievedData": { "results": [ { "details": [ { "moredetails": [{ "id": "123456", "price": "129.99", "recorded_at": 3223322, "lastrecorded_at": 0002020, "seller": "google", "availability": "Available", "currency": "USD" }], "offers_count": 1, "name": "google.com", "recentoffers_count": 1, "sid": "988008555566649", "url": "http://google.com" }, "moredetails"{ . . } ] details { { [ ] } "model": "abc", "weight": "127", "price_currency": "USD", "features": { . ' } "model": "abc", "weight": "127", "price

Should I provide parent resource name in URL or not in RESTful WS?

左心房为你撑大大i 提交于 2019-12-04 18:36:52
I am developing some basic restful web services using PHP and apache and I am wondering whether I should build the URLs providing the parent entity name or not. Let me explain this better: I have 2 entities, lets suppose countries and cities . I am now just providing WS to get, create, update or delete cities but the API won't support countries manipulation via WS. I am remapping urls using mod_rewrite and I am providing the following urls in the api to manipulate cities: . GET /api/countries/<country_id>/cities cities of country with id <country_id> . GET /api/countries/<country_id>/cities/

How to retrieve result for Google QPX with Javascript/jQuery (Ajax)?

徘徊边缘 提交于 2019-12-04 17:42:45
I have already signed up for Google API Console and set up the account and API key, but my question is how do I retrieve the results from Google QPX. What causes the error below? Setting up the json Query for Google Request var FlightRequest = { "request": { "slice": [ { "origin": "DCA", "destination": "LAX", "date": "2015-02-11" } ], "passengers": { "adultCount": 1, "infantInLapCount": 0, "infantInSeatCount": 0, "childCount": 0, "seniorCount": 0 }, "solutions": 20, "refundable": false } } Requesting the Data and Returning it. $.ajax({ url: "https://www.googleapis.com/qpxExpress/v1/trips

Alternative to <a href=“#”> when the anchor tag only triggers a jQuery action without redirecting the user?

别来无恙 提交于 2019-12-04 12:06:19
问题 I have numerous anchor tags on my page that only trigger jQuery actions on the same page. The don't redirect the user to another location, which is the normal expected behavior of an anchor tag. I don't want to have restful urls in my app for every action. But, I also don't like sending the user to the top of the page every time they click on one of these <a href="#"> tags. What's a better value to put inside the href value of the anchor tag besides # ? 回答1: Can you reference a fragment on

Laravel resource controllers for both API and non-API use

試著忘記壹切 提交于 2019-12-04 10:40:08
After creating a resource controller PhotosController for a website that also does AJAX calls to the API, it appears that the resource controller can be used on both the normal website and as the API. This displays a HTML page for Photo with id = 1 http://domain.com/photos/1 and Javascript uses the following which updates the Photo resource and returns a JSON response PUT http://domain.com/api/v1/photos/1 Question: Will we have 2 PhotoControllers , one to handle API usage and one for non-API? No. You can have two separate routes point to the same controller and action. Route::get('/photos/1',

is restful meant for web services only OR for both web services AND web pages?

若如初见. 提交于 2019-12-04 08:24:18
I read a lot of Restful tutorials for PHP. (I don't want to go in depth into why I am not using RoR. It is due to the team being more familiar with PHP) Because we are planning for future expansion into having APIs i read that it is important to implement Restful web services. I have looked at tutorials such as http://www.gen-x-design.com/archives/create-a-rest-api-with-php/ Apparently restful is meant for webservices. What about for webpages? can they be RESTFUL as well? if the answer is NO, please do not go beyond this line AND just tell me. Thank you. i know to make the urls look like

redirect from JSP is in type pending and status canceled

Deadly 提交于 2019-12-04 05:30:35
问题 I'm having a JSP file that is calling a REST post call which doing a get to a remote server. the request is being processed but get pending in the remote machine in status canceled. can you please assist? here is part of the JSP:` <tr> <td><button id="registerBtn" onclick="registerClick()">Register</button></td> <td><button id="loginBtn" onclick="postOnClick()">Log in</button></td> </tr> </table> <script type='text/javascript'> function registerClick() { /* var params = "{realm: astra,

REST - Creating Nested Resources with single POST

Deadly 提交于 2019-12-04 05:16:34
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 creation of /notices/{notice} and /notices/{notice}/photos/{photo} with a single POST request to /notices/

What is the difference between @PathParam and @PathVariable

有些话、适合烂在心里 提交于 2019-12-03 18:45:46
问题 To my knowledge both serves the same purpose. Except the fact that @PathVariable is from Spring MVC and @PathParam is from JAX-RS. Any insights on this? 回答1: @PathVariable and @PathParam both are used for accessing parameters from URI Template Differences: As you mention @PathVariable is from spring and @PathParam is from JAX-RS. @PathParam can use with REST only, where @PathVariable used in Spring so it works in MVC and REST. 回答2: PathParam: To assign URI parameter values to method arguments

RESTful API routes design: nested vs. non-nested

只愿长相守 提交于 2019-12-03 15:50:07
问题 My question is about the advantages of nesting resources when building URLs for API purposes. Consider the following two alternatives for accessing an employee resource: /api/employees?department=1 # flat Vs. /api/departments/1/employees # nested Now consider the task of developing a general purpose library to access REST resources from an API. If all routes were flat, such a REST wrapper library would only need to know the name of the resource being accessed: store.query('employees',