This header explains what type of information is in the body of the request. Get.setHeader("User-Agent", "my-integration/1.2.3") Content-Type In that case, you’d submit the following user-agent header in Java using the GET verb: Then you need an HTTP agent to manage the information exchange between your application and New Relic and you need to identify that integration. This header enables servers to identify the application, operating system, vendor, and/or version of the user agent making the request.įor example, let’s say you want your application to work with New Relic's RESTful APIs. Three common headers are user-agent, content-type, and accept. Including a header ensures the API understands what you’re asking and responds in a way that’s expected and easy for you to understand and use. The next thing you need to include is a header, which tells the API about your request and the response you’re expecting. So you can use Excel to make the call and get a simple list of five alternative stations. If you’re not familiar with JSON, that might look intimidating. If that list doesn’t, then it will send back the HTTP response code 404 (not found). If that list exists, the server will send back a copy of that resource in XML or JSON and an HTTP response code of 200 (OK). This tells the server to search the database to find a list of alternative fuel stations in Denver. Then you’d make a GET request that might look like:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |