Solved

Web Service Calls to Get a Header retrieval

Posted on 2014-04-03
4
178 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Suggested Courses

626 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