Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding server response examples #414

Merged
merged 2 commits into from
Oct 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions dev-docs/bidder-adapter-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,12 @@ The `interpretResponse` function will be called when the browser has received th
{% highlight js %}

// if the bid response was empty or an error, return []
// otherwise parse the response and return a bidReponses array
// otherwise parse the response and return a bidResponses array

// The response body and headers can be retrieved like this:
//
// const serverBody = serverResponse.body;
// const headerValue = serverResponse.headers.get('some-response-header')
const bidResponses = [];
const bidResponse = {
requestId: bidRequest.bidId,
Expand Down Expand Up @@ -437,12 +441,13 @@ export const spec = {
/**
* Unpack the response from the server into a list of bids.
*
* @param {*} serverResponse A successful response from the server.
* @param {ServerResponse} serverResponse A successful response from the server.
* @return {Bid[]} An array of bids which were nested inside the server.
*/
interpretResponse: function(serverResponse, bidRequest) {
// const serverBody = serverResponse.body;
// const headerValue = serverResponse.headers.get('some-response-header')
const bidResponses = [];
// loop through serverResponses {
const bidResponse = {
requestId: bidRequest.bidId,
cpm: CPM,
Expand Down