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

Undeprecated HttpRequest::getQueryParameter and ... #2379

Merged
merged 3 commits into from
Oct 4, 2021

Conversation

slaff
Copy link
Contributor

@slaff slaff commented Sep 30, 2021

removed the old deprecated elements.

  • Undeprecated HttpRequest::getQueryParameter.

And removed a lot of old deprecated code.

  • Removed WebsocketClient::disconnect (). Use WebsocketClient::close() instead.
  • Removed TimerDelegateStdFunction. Use TimerDelegate instead.
  • Removed class URL. Use class Url instead.
  • Removed TemplateVariables Use TemplateStream::Variables instead.
  • Removed StreamTransformer::transformCallback. Create inherited class and override transform() method instead.
  • Removed StreamTransformer::StreamTransformer (IDataSourceStream *stream, const StreamTransformerCallback &callback, size_t resultSize=256, size_t blockSize=64). Create inherited class, override transform() method and Use alternative constructor instead.
  • Removed SslValidatorCallback. Use Ssl::ValidatorCallback instead.
  • Removed SslSessionId and SSLSessionId. Use Ssl::SessionId instead.
  • Removed SslKeyCertPair and SSLKeyCertPair. Use Ssl::KeyCertPair instead.
  • Removed SslCertificate. Use Ssl::Certificate instead.
  • Removed SeekOriginFlags. Use SeekOrigin instead.
  • Removed eSO_FileStart. Use SeekOrigin::Start instead.
  • Removed eSO_CurrentPos. Use SeekOrigin::Current instead.
  • Removed eSO_FileEnd. Use SeekOrigin::End instead.
  • Removed OtaUpgrade::BasicStream::errorToString. Use toString() global function.
  • Removed deprecated stuff in Mqtt. Removed MQTT_MAX_BUFFER_SIZE, MQTT_MSG_PUBREC,
  • Removed MqttClient::publishWithQoS (const String &topic, const String &message, int QoS, bool retained=false, MqttMessageDeliveredCallback onDelivery=nullptr).
    Use publish(const String& topic, const String& message, uint8_t flags = 0) instead.
    If you want to have a callback that should be triggered on successful delivery of messages then Use setEventHandler(MQTT_TYPE_PUBACK, youCallback) instead.
  • Removed MqttClient::setCallback (MqttStringSubscriptionCallback subscriptionCallback=nullptr). Use MqttClient::setEventHandler(MQTT_TYPE_PUBLISH, MqttDelegate handler) instead.
  • Removed MqttClient::setWill (const String &topic, const String &message, int QoS, bool retained=false). Use MqttClient::setWill(const String& topic, const String& message,uint8_t flags) instead.
  • Removed MqttMessageDeliveredCallback. Use MqttDelegate instead.
  • Removed MqttStringSubscriptionCallback. Use MqttDelegate instead.
  • Removed IDataSourceStream::length(). Use IDataSourceStream::available() instead.
  • Removed HttpServer::setDefaultResource (HttpResource *resource). Use paths.setDefault() instead.
  • Removed HttpServer::addPath (String path, const HttpPathDelegate &callback), HttpServer::addPath (const String &path, const HttpResourceDelegate &onRequestComplete) and HttpServer::addPath (const String &path, HttpResource *resource). Use paths.set() instead.
  • Removed HttpResponse::toString (const HttpResponse &res). Use HttpResponse::toString() method or toString(HttpResponse) function instead.
  • Removed HttpResponse::sendTemplate (IDataSourceStream *newTemplateInstance). Use sendNamedStream() instead.
  • Removed commandFunctionDelegate. Use CommandFunctionDelegate instead.
  • Removd DateTime::convertFromUnixTime (time_t timep, int8_t psec, int8_t pmin, int8_t phour, int8_t pday, int8_t pwday, int8_t pmonth, int16_t pyear).
    Use fromUnixTime(time_t, uint8_t
    , uint8_t
    , uint8_t
    , uint8_t
    , uint8_t
    , uint8_t
    , uint16_t
    ) instead.
  • Removed DateTime::convertToUnixTime (uint8_t sec, uint8_t min, uint8_t hour, uint8_t day, uint8_t month, uint16_t year). Use 'toUnixTime()' instead.
  • Removed DateTime::fromUnixTime (time_t timep, int8_t psec, int8_t pmin, int8_t phour, int8_t pday, int8_t pwday, int8_t pmonth, int16_t pyear). Use unsigned version instead fromUnixTime(time_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint16_t).
  • Removed DateTime::parseHttpDate (const String &httpDate). Use fromHttpDate() instead.
  • Removed DNSServer. Use DnsServer instead.
  • Removed eFO_Append. Use File::Append instead.
  • Removed eFO_CreateIfNotExist. Use File::Create instead.
  • Removed eFO_CreateNewAlways. Use File::CreateNewAlways instead.
  • Removed eFO_ReadOnly. Use File::ReadOnly instead.
  • Removed eFO_ReadWrite. Use File::ReadWrite instead.
  • Removed eFO_Truncate. Use File::Truncate instead.
  • Removed eFO_WriteOnly. Use File::WriteOnly instead.
  • Removed eSO_CurrentPos. Use SeekOrigin::Current instead.
  • Removed eSO_FileEnd. Use SeekOrigin::End instead.
  • Removed eSO_FileStart. Use SeekOrigin::Start instead.
  • Removed fileList (). Use Directory object (or fileOpenDir / fileReadDir / fileCloseDir).
  • Removed FileStream::attach (const String &fileName, FileOpenFlags openFlags=File::ReadOnly). Use FileStream::open() instead.
  • Removed FTPServer. Use FtpServer instead.
  • Removed FtpServer::checkUser (const String &login, const String &pass). Use FtpServer::validateUser() instead
  • Removed Hardware_Timer. Use HardwareTimer class instead.
  • Removed HardwareSerial::setCallback (StreamDataReceivedDelegate dataReceivedDelegate). Use HardwareSerial::onDataReceived instead.
  • Removed HttpClient::request (const String &url). Use createRequest() instead.
  • Removed HttpConnection::getLastModifiedDate (). Use getResponse()->headers.getLastModifiedDate() instead.
  • Removed HttpConnection::getResponseCode (). Use getResponse()->code instead.
  • Removed HttpConnection::getResponseHeader (const String &headerName, const String &defaultValue=nullptr). Use getResponse()->headers[] instead.
  • Removed HttpConnection::getResponseHeaders (). Use getResponse()->headers instead.
  • Removed HttpConnection::getResponseString (). Use getResponse()->getBody() instead.
  • Removed HttpConnection::getServerDate (). Use getResponse()->headers.getServerDate() instead.
  • Removed httpGetErrorName (HttpError err). Use toString(HttpError) instead.
  • Removed HttpPartProducerDelegate. Use MultipartStream::Producer instead.
  • Removed HttpPartResult. Use MultipartStream::BodyPart instead.
  • Removed HttpRequest::getPath (). Use uri.Path instead.
  • Removed HttpRequest::operator= (const HttpRequest &rhs). Use clone() instead.
  • Removed HttpRequest::setPostParameters (const HttpParams &params). Set postParams directly, i.e. request.postParams = params.
  • Removed HttpResponse::forbidden (). Use response.code = HTTP_STATUS_FORBIDDEN instead.
  • Removed HttpResponse::hasHeader (const String &name). Use headers.contains() instead.
  • Removed HttpResponse::notFound (). Use response.code = HTTP_STATUS_NOT_FOUND instead.
  • Removed HttpResponse::redirect (const String &location). Use headers[HTTP_HEADER_LOCATION] instead.

@slaff slaff added this to the 4.5.0 milestone Sep 30, 2021
@mikee47
Copy link
Contributor

mikee47 commented Oct 1, 2021

@slaff Maybe we should un-deprecate the eFO_xxx flags - there's probably a lot of code that still uses them and not sure how to apply SMING_DEPRECATED to those.

@mikee47 mikee47 force-pushed the deprecated/remove-old-deprecations branch from 7985341 to 055968a Compare October 3, 2021 07:36
Not using MBEDTLS so should be fine to disable certificate bundles.
@mikee47 mikee47 force-pushed the deprecated/remove-old-deprecations branch from 055968a to bc2a63b Compare October 3, 2021 08:52
@slaff slaff merged commit d8b8d7c into SmingHub:develop Oct 4, 2021
@slaff slaff mentioned this pull request Oct 4, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants