Announcement

Collapse
No announcement yet.

Outputting HTTP error codes?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Outputting HTTP error codes?

    Hi folks,

    I'm working on a project where the store will accept incoming requests from another server with custom Action codes. In case of errors, the client wants the store to reply by setting a value other than 200 in the HTTP reply status. I've used miva_output_header() before to generate type-301 redirects, so I have the general idea. But I have a few questions about the details
    .
    - If the store is using the Status header to send an error code, is there another header that I can use to send some sort of description text?

    - Does the store have to send some minimal amount of text or other "real" content for this to work? Or can it just output a header and exit?

    Thanks --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    #2
    You can always use a 200 status code, meaning success, with a custom header if you'd prefer to give the other server result codes that come at the HTTP layer instead of in the payload. You'd just not want to use a common one that's already used, such as htscallerid (the cookie name Empresa uses), mm5-STORECODE-basket-id (insecure session id), etc. You can make up the name and value. So you could have:

    X-Kent-Status: success123
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment


      #3
      Looks good! Thanks for the quick reply too!
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment

      Working...
      X