Skip to content

Commit

Permalink
fix: improved the RequestRecordingStart internal struct obj. Extracte…
Browse files Browse the repository at this point in the history
…d it to another struct
  • Loading branch information
Paxx committed Jun 29, 2023
1 parent 63c4c0f commit fa039bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions ovenmedia/ovenmedia.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ func (o *ovenMedia) IsDebug() bool {
// Resty Methods

func (o *ovenMedia) post(url string, body interface{}) (*resty.Response, error) {
resp, err := o.restClient.R().
SetHeader("Accept", "application/json").
SetBody(body).
Post(url)
r := o.restClient.R().
SetHeader("Accept", "application/json")

if body != nil {
r.SetBody(body)
}

resp, err := r.Post(url)

if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion ovenmedia/recording.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (o *ovenMedia) StopRecording(vHost string, appName string, body RequestReco

//

func (o *ovenMedia) GetRecordingState(vHost string, appName string, body RequestRecordingStop) (*ResponseRecordingStart, error) {
func (o *ovenMedia) GetRecordingState(vHost string, appName string, body *RequestRecordingStop) (*ResponseRecordingStart, error) {
//
resp, err := o.post(GET_VHOSTS_RECORDS_BY_NAME(vHost, appName), body)
if err != nil {
Expand Down

0 comments on commit fa039bb

Please sign in to comment.