Options
All
  • Public
  • Public/Protected
  • All
Menu

This is returned to you when "outputAsJson=true".

Hierarchy

  • IUserResponse

Index

Properties

content

content: { contentErrors?: { frame: string; message: string; name: string }[]; data: string; doneDetail?: IDoneDetail; encoding: "utf8" | "base64"; eventPhase?: IPageEventPhase; execErrors?: { frame: string; message: string; name: string }[]; extraHeaders?: {}; headers?: {}; name: string; pageExecLastWaitedOn?: string; passThroughStatusCode?: boolean; resourceSummary?: IResourceSummary; size: number; statusCode: number; url: string }

the rendered output of the last IPageRequest

Type declaration

  • Optional contentErrors?: { frame: string; message: string; name: string }[]

    new for Chrome backend. if your IPageRequest had any content errors, they will be listed here.

  • data: string

    data in either base64 or utf8 format, or JSON. see content.encoding and content.name for hints as to the type

  • Optional doneDetail?: IDoneDetail

    new for Chrome backend. information on what finished the page execution.

    If normal then most likely everything was rendered properly. If another value, be advised your content may not have rendered properly. Inspect the value of statusCode and Please see contentErrors and/or execErrors for details on what could have occured. Additionaly, inspect other parameters for hints, such as resourceSummary and pageExecLastWaitedOn

  • encoding: "utf8" | "base64"

    utf8 or base64

  • Optional eventPhase?: IPageEventPhase

    new for Chrome backend. the rendered page's final eventPhase. see IPageResponse.eventPhase for further explanation

  • Optional execErrors?: { frame: string; message: string; name: string }[]

    new for Chrome backend. if the rendering system experienced any errors when processing the page, they will be listed here.

  • Optional extraHeaders?: {}

    extra response headers you want sent with your response. set by IRenderSettings.extraResponseHeaders

    • [name: string]: string
  • Optional headers?: {}

    headers of the target url, only set if IRenderSettings.passThroughHeaders===true

    • [name: string]: string
  • name: string

    filename you could use if saving the content to disk. this will be something like 'content.text', 'content.jpeg', 'content.pdf' thus this informs you of the content type

  • Optional pageExecLastWaitedOn?: string

    new for Chrome backend. for debugging your request, if our IPageRequest didn't succeed with statusCode 200, we'll output the last thing waited on.

  • Optional passThroughStatusCode?: boolean

    set via IRenderSettings.passThroughStatusCode, if this is true, when returning the response to you, the content's status code will be sent, irrespective of your API statusCode.

  • Optional resourceSummary?: IResourceSummary

    new for Chrome backend. summary of all resources requested by the page. see IPageResponse.resources for detailed listings

  • size: number

    the size of data, in bytes

  • statusCode: number

    status of the content.

    • 200: Everything good, no errors were encountered at all
    • 408: The targetURL was unable to load.
    • 424: Some errors were encountered during rendering the page. These may be harmless script errors in the page itself, but it also may be something that could impact your rendered output. Please see contentErrors and/or execErrors for details. Additionaly, inspect other parameters for hints, such as resourceSummary and pageExecLastWaitedOn
  • url: string

    the final url of the IPageRequest after redirects

Optional meta

meta: { backend?: { id: string; os: string; platform: string; platformVersion: any; requestsProcessed: number }; billing?: { bytes: number; creditCost?: number; dailySubscriptionCreditsRemaining?: number; elapsedMs: number; endTime?: string; prepaidCreditsRemaining?: number; proxyIngressBytes: number; proxyIngressCost: number; startTime?: string }; outputAsJson?: boolean; trace?: { data: any; elapsedMs: number; time: string }[] }

metadata about the transaction

Type declaration

  • Optional backend?: { id: string; os: string; platform: string; platformVersion: any; requestsProcessed: number }

    information about the PhantomJsCloud.com system processing this transaction

    • id: string

      identifier of the system, for troubleshooting purposes

    • os: string
    • platform: string

      Chrome or PhantomJs

    • platformVersion: any

      (major/minor/point)

    • requestsProcessed: number

      number of requests processed by this backend

  • Optional billing?: { bytes: number; creditCost?: number; dailySubscriptionCreditsRemaining?: number; elapsedMs: number; endTime?: string; prepaidCreditsRemaining?: number; proxyIngressBytes: number; proxyIngressCost: number; startTime?: string }

    how much this transaction costs. NOTE: the creditCost, prepaidCreditsRemaining, and dailySubscriptionCreditsRemaining are also returning in the HTTP Response Headers via the keys pjsc-credit-cost, pjsc-daily-subscription-credits-remaining, and pjsc-prepaid-credits-remaining

    • bytes: number

      bytes egress

    • Optional creditCost?: number

      the total cost of this response

    • Optional dailySubscriptionCreditsRemaining?: number

      estimation of your remaining daily creditBalance. This is incrementally refilled hourly.

    • elapsedMs: number
    • Optional endTime?: string

      the end time of your IUserRequest.

    • Optional prepaidCreditsRemaining?: number
    • proxyIngressBytes: number

      bytes ingress when using a built-in proxy (including geolocation)

    • proxyIngressCost: number

      cost of geo or builtin proxy

    • Optional startTime?: string

      the start time of your IUserRequest.

  • Optional outputAsJson?: boolean

    if true, informs our server to send back JSON, including the response plus metadata. if False, if should send back only the content.

    default

    false

  • Optional trace?: { data: any; elapsedMs: number; time: string }[]

    debug trace information provided by the api.

originalRequest

originalRequest: IUserRequest

the original request, without defaults applied. to see the request with defaults, see IPageResponse.pageRequest

pageResponses

pageResponses: IPageResponse[]

a collection of load/processing information for each IPageRequest you requested.

queryJson

queryJson: any[]

output from IPageRequest.queryJson. used to reduce output verbosity.

statusCode

statusCode: number

the HTTP Status Code PhantomJsCloud returns to you

statusMessage

statusMessage: string

if an error was detected, we will try to supply a statusMessage to help debug. Additionally,this will be placed as the pjsc-status-message response header.