Bug #1050

Function to access request content

Added by Jan Dolinár about 9 years ago. Updated over 8 years ago.

Status:ApprovedStart date:05/02/2015
Priority:NormalDue date:
Assignee:Jan Dolinár% Done:

0%

Category:SkylarkSpent time:-
Target version:-

Description

There is currently no way to access the content of request in Skylark. This is wrong, because sometimes, the request body can contain important information. The information is actually read by Http class, but it is not directly accessible to the user. Therefore I suggest to add this one simple method:

const String& Http::GetContent() const {
    return content;
}

My actual usecase: I am trying to write a method that will accept "web hook" initiated from gitlab instance when someone pushes to the repository. Gitlab can be instructed to send a request to any url, but it is always POST request, where body contains JSON data describing the pushed commits and Content-Type is application/json. So right now, there is no way to get the data, because Skylark only reads content if Content-Type is one of application/x-www-form-urlencoded* or multipart/*.

History

#1 Updated by Miroslav Fidler about 9 years ago

  • Status changed from Patch ready to Ready for QA
  • Assignee changed from Miroslav Fidler to Jan Dolinár

Good idea, but I rather used "GetRequestContent" to avoid confusion with response content (which now is referred to as 'Content'...)

#2 Updated by Miroslav Fidler over 8 years ago

  • Status changed from Ready for QA to Approved

Also available in: Atom PDF