Mercurial > hg > orthanc
comparison Core/RestApi/RestApiOutput.cpp @ 473:c9a5d72f8481
changing the namespace of HTTP enumerations
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 15 Jul 2013 17:22:13 +0200 |
parents | bdd72233b105 |
children | 2d0a347e8cfc |
comparison
equal
deleted
inserted
replaced
472:722b56b99093 | 473:c9a5d72f8481 |
---|---|
46 | 46 |
47 RestApiOutput::~RestApiOutput() | 47 RestApiOutput::~RestApiOutput() |
48 { | 48 { |
49 if (!alreadySent_) | 49 if (!alreadySent_) |
50 { | 50 { |
51 output_.SendHeader(Orthanc_HttpStatus_400_BadRequest); | 51 output_.SendHeader(HttpStatus_400_BadRequest); |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 void RestApiOutput::CheckStatus() | 55 void RestApiOutput::CheckStatus() |
56 { | 56 { |
98 CheckStatus(); | 98 CheckStatus(); |
99 output_.Redirect(path); | 99 output_.Redirect(path); |
100 alreadySent_ = true; | 100 alreadySent_ = true; |
101 } | 101 } |
102 | 102 |
103 void RestApiOutput::SignalError(Orthanc_HttpStatus status) | 103 void RestApiOutput::SignalError(HttpStatus status) |
104 { | 104 { |
105 if (status != Orthanc_HttpStatus_403_Forbidden && | 105 if (status != HttpStatus_403_Forbidden && |
106 status != Orthanc_HttpStatus_415_UnsupportedMediaType) | 106 status != HttpStatus_415_UnsupportedMediaType) |
107 { | 107 { |
108 throw OrthancException("This HTTP status is not allowed in a REST API"); | 108 throw OrthancException("This HTTP status is not allowed in a REST API"); |
109 } | 109 } |
110 | 110 |
111 CheckStatus(); | 111 CheckStatus(); |