restful-url

How to create REST URLs without verbs?

杀马特。学长 韩版系。学妹 提交于 2019-12-17 02:51:40
问题 I'm struggling to determine how to design restful URLs. I'm all for the restful approach of using URLs with nouns and not verbs don't understand how to do this. We are creating a service to implement a financial calculator. The calculator takes a bunch of parameters that we will upload via a CSV file. The use cases would involve: Upload new parameters Get the latest parameters Get parameters for a given business date Make a set of parameters active Validate a set of parameters I gather the

Multi-lingual REST resources - URL naming suggestions

丶灬走出姿态 提交于 2019-12-14 00:21:47
问题 Is there a REST best practice for GETting resources in different languages. Currently, we have www.mysite.com/books?locale=en I know we can use the accept-language header but is it better for us to do www.mysite.com/books/en or www.mysite.com/books.en or does it not matter? 回答1: I think best way would be to implement this following way: HTTP's Accept-Language header Language prefix in URI such as /en/books/... In other words you can accept language from both sources. Implementation will be

passing JSON object in URL of RESTFUL Web service in Android?

被刻印的时光 ゝ 提交于 2019-12-13 18:32:14
问题 I am working with JSON Restful web serivces where I have to pass JSON object in the Service URL. I have created the JSON object successfully but getting exception when my URL created the HTTP connection with the SERVER. Below I have mention my URL: http://72.5.167.50:8084/UpdateProfileInfo?{"ProfileEditId":"917","ContactsEmail":[{"Email":"dsfs","ContactId":""}],"ContactsPhone":[{"CountryId":"+1","Type":"2","Phone":"345345"}],"ProfileId":"290","LastName":"demo","GroupId":"1212","Title":"sdf",

Validate/Change Password via REST API

此生再无相见时 提交于 2019-12-13 13:12:24
问题 I want to change a user password via a REST API. This is not a forgotten or reset password function, but a logged in user wanting to change their password. The form requires the current password, the new password, and a confirmation for the new password. However, I want to validate each form field as the user fills it out. This is trivial for newPassword and confirmNewPassword (client side), but not for currentPassword . Currently performing update to the User object via PUT /users/:id . If a

Designing a RESTful website [closed]

£可爱£侵袭症+ 提交于 2019-12-13 12:42:19
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I am trying to learn to create RESTful web applications. I have a few doubts. Say, I have a requirement to display the name of user on the website header. I used to do it by storing the user object in session and then fetching the name in the JSP. But now, isn't that storing

No converter found for return value of type: class java.util.ArrayList

亡梦爱人 提交于 2019-12-13 08:58:13
问题 I m following a spring boot example from a tutorial wich implement a Restful service to get the list of persons from Database table , but I m getting an error when I call : http://localhost:8080/person on IE : No converter found for return value of type: class java.util.ArrayList . So far I tried to add Jackson dependencies from a suggestion on stackoverflow , following my classes, any help is appreciated . SpringbootApplication : package ben; @SpringBootApplication @EnableAutoConfiguration

Matlab RESTful PUT Command - net.http - nesting body values

纵然是瞬间 提交于 2019-12-13 04:28:53
问题 I am using Matlab's matlab.net.http library to launch get, put and post commands to a website. I can successfully launch get and post commands. For example: MyBody = matlab.net.http.MessageBody(struct('Id',YYYYYY,'WindfarmId',XXX,'Month','YYYY-MM-DD')); Request = matlab.net.http.RequestMessage; Request.Method = 'POST'; Request.Header = matlab.net.http.HeaderField('Content-Type','application/json','Authorization',['Basic ' matlab.net.base64encode([Username ':' Password])]); Request.Body =

Getting error while receiving Object in restful webservice

自闭症网瘾萝莉.ら 提交于 2019-12-13 04:28:27
问题 Code i used to convert my reg_be obj to is inputstream. ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(reg_be); oos.flush(); oos.close(); InputStream is = new ByteArrayInputStream(baos.toByteArray()); Then i pass this inputstream to webservice. My web service code is public String getText(@Context HttpServletRequest request) throws IOException { // Registration_BE reg_be=new Registration_BE(); InputStream in

Nginx location directive with regular expression to extract folder name and using in try_files

牧云@^-^@ 提交于 2019-12-12 18:17:00
问题 I'm currently using the following location directive along with the try_files for a restfull application: location /branches/branchx/app/api/ { try_files $uri $uri/ /branches/branchx/app/api/api.php$is_args$args; } Where branchx is the name of my Git branch. I may therefore have multiple branches such as: branch1 , branch2 , etc.. And therefore I need to manually create a directive for each and every branches I will create. To avoid this issue, I'm looking to use a regular expression to

RESTful API behavior for entitys with two independent primary keys

冷暖自知 提交于 2019-12-12 11:00:00
问题 I have the following entity: <car> <carID>7</carID> <...>...</...> <externalCarID>23890212</externalCarID> </car> The problem is now that carID and externalCarID are both independent primary keys that are used by/for different systems and it should be possible for API clients to access a car entity with both the carID xor the externalCarID . Both keys are ints and they do not use disjoint sets: carID(7) != externalCarID(7) I have thought of the following solutions: Access it with /restapi/car