Solved

Web Service Calls to Get a Header retrieval

Posted on 2014-04-03
4
176 Views
Last Modified: 2014-04-10
Hello, I am looking for a way to get a header section retrieved by posting a url.  How do I do this?  The url would be done by a REST API.  Does anybody know how the REST api works?  Thanks!
0
Comment
Question by:VBBRett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39977758
You can use jquery  http://api.jquery.com/jquery.getjson/ and below is sample to use a flicker api
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery.getJSON demo</title>
  <style>
  img {
    height: 100px;
    float: left;
  }
  </style>
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<div id="images"></div>
 
<script>
(function() {
  var flickerAPI = "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";
  $.getJSON( flickerAPI, {
    tags: "mount rainier",
    tagmode: "any",
    format: "json"
  })
    .done(function( data ) {
      $.each( data.items, function( i, item ) {
        $( "<img>" ).attr( "src", item.media.m ).appendTo( "#images" );
        if ( i === 3 ) {
          return false;
        }
      });
    });
})();
</script>
 
</body>
</html>

Open in new window


MS  has a video on consuming a WCF http://msdn.microsoft.com/en-us/data/gg617675

If you use jquery ajax https://api.jquery.com/jQuery.ajax/ you can use the head method
$.ajax({
  type: "HEAD",
  url: "/Folder/URL/",
  data: { name: "John", location: "Boston" }
})
  .done(function( msg ) {
    alert( "Data Saved: " + msg );
  });

Open in new window

0
 
LVL 25

Expert Comment

by:apeter
ID: 39978525
You want to read the header in "asp.net web api" controller ?
0
 

Author Comment

by:VBBRett
ID: 39978632
Here is what I am attempting to do:

I know how to work with web services to a degree like MVC, WCF, etc, but I am looking to work with a REST API from Oracle's Taleo.  So, here is the process that I am trying to do:

1. Use a POST url which contains a user id and password and be able to retrieve a response which contains a record called authToken.  So the response should be something like the following when running it through FireFox RESTClient:

"response" : {"authoToken: "webapi123456789101112131415"}, "status" :{"detail" :{}, "success":true}}

2. Attach the "webapixxx" string as a header authToken and send a GET with  URL to get records back.  Not sure exactly how this is done.  If you guys could guide me, I'd appreciate that.  Thanks!  And one more thing, can this be done with a console application?
0
 
LVL 53

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 500 total points
ID: 39978661
In the console you can always run the code on the page and view the response back.  In chrome console, click on the Network tab, then find the page you are posting to.  Make your call and you will see the page added.  Now click on that and you can see the headers, preview and response on the right.  All the browser consoles will work about like that.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
setting backkground on single page on wordpress 4 41
CSS (jquiry mobile) question 3 34
Anchor Bookmark 6 34
Responsive Image Distorting 2 29
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question