restful-url

Unable to disable ssl verification in cURL

喜你入骨 提交于 2019-11-30 16:32:24
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 XMLs in the response , the output is some html page showing the following error HTTPS Request Blocked

Is it better to place a REST API on a subdomain or in a subfolder? [closed]

烈酒焚心 提交于 2019-11-30 11:37:43
问题 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 6 years ago . We have a web application which is hosted with the URL http://example.com . Now we want to extend a part of this application as a restful service, and we are debating on the best URL pattern. I searched, but could not find any concrete guidance. Should we have the URL pattern

How to parse Multiple JSON Objects and arrays from a url in android? i am using a example i want it in that example,

笑着哭i 提交于 2019-11-30 07:19:02
问题 I want below process on with out editing on server side I followed this example but over there he is calling data with one json object from a url called "worldpopulation",.. but i have a Json data which is having lot of Json objects and arrays,.. like below code { "getting data":"ok" "Todays":population {"results"{[ "worldpopulation": [ { "rank":1,"country":"China", "population":"1,354,040,000", "flag":["http://www.androidbegin.com/tutorial/flag/china.png"] }, { "population":{ [

Restful URLs with data in query string or request body?

╄→гoц情女王★ 提交于 2019-11-30 04:16:28
What's the rule of thumb for passing data in a REST URL in the query string vs. the body of a request? Ie: You're creating a service to add hockey players. You could go with: PUT /players { "name": Gretzky } or PUT /players?name=Gretzky If you're passing a lot of data, you would need to go with option #1 as there is a limit on the URL length. But other than this, why not just use the query string to pass data? Update : Removed comment that you could test option #2 in a browser. Realized (duh) that you can only do GET-s in your browser. Based on HTTP's definition of PUT, your first request is

HTTP POST response Location header when creating multiple resources

不问归期 提交于 2019-11-30 03:04:22
问题 The HTTP/1.1 standard states that if a POST operation results in the creation of a resource, then the response should include a Location header with the address of the new resource. If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity which describes the status of the request and refers to the new resource, and a Location header (see section 14.30). and in section 14.30, For 201 (Created) responses, the Location is that of the new

Is it better to place a REST API on a subdomain or in a subfolder? [closed]

人盡茶涼 提交于 2019-11-30 02:46:24
We have a web application which is hosted with the URL http://example.com . Now we want to extend a part of this application as a restful service, and we are debating on the best URL pattern. I searched, but could not find any concrete guidance. Should we have the URL pattern http://api.example.com or http://exaple.com/api/v1 ? Is there any standard guidance for this? Jobert Enamno It depends on your needs. If you use http://api.example.com it makes your API a subdomain. Basically, this URL pattern is good if your REST service is to be consumed by multiple clients, but if only one client is

What is the difference between @PathParam and @PathVariable

霸气de小男生 提交于 2019-11-30 01:22:29
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? @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. PathParam: To assign URI parameter values to method arguments. In Spring, it is @RequestParam . Eg., http://localhost:8080/books?isbn=1234 @GetMapping("/books/") public Book

RESTfully design /login or /register resources?

ⅰ亾dé卋堺 提交于 2019-11-29 18:36:12
I was designing a web app and then stopped to think about how my api should be designed as a RESTful web service. For now, most of my URI's are generic and might apply to various web apps: GET /logout // destroys session and redirects to / GET /login // gets the webpage that has the login form POST /login // authenticates credentials against database and either redirects home with a new session or redirects back to /login GET /register // gets the webpage that has the registration form POST /register // records the entered information into database as a new /user/xxx GET /user/xxx // gets and

Log restful endpoints on container startup in a Spring application

烂漫一生 提交于 2019-11-29 15:52:31
I've a Spring application that expose restful endpoints through @RequestMapping annotation in Controller classes. I wish that were logged into the console, at server startup, all the endpoints of all the application's controller. I use a tomcat server and log4j for logging. Thanks. For those who use spring-boot: In the latest spring-boot release (since v2.1), they changed the mapping default log level (as specified in the Release Notes here ). Add one of the following properties to application.properties file: logging.level.web=TRACE logging.level.org.springframework.web=TRACE Sample Console

Restful URLs with data in query string or request body?

陌路散爱 提交于 2019-11-29 02:13:05
问题 What's the rule of thumb for passing data in a REST URL in the query string vs. the body of a request? Ie: You're creating a service to add hockey players. You could go with: PUT /players { "name": Gretzky } or PUT /players?name=Gretzky If you're passing a lot of data, you would need to go with option #1 as there is a limit on the URL length. But other than this, why not just use the query string to pass data? Update : Removed comment that you could test option #2 in a browser. Realized (duh)