Skip to content

Commit bbcfdcf

Browse files
Merge pull request #37 from AppcentMobile/bugfix/content-type-header
🎷 [BUGFIX] Content-type added.
2 parents 2604a8e + 014f477 commit bbcfdcf

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Sources/ACMOpenAI/Constants/ACMOAIConstants.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
/// Constants for holding open ai data
66
struct ACMOAIConstants {
77
static let organizationHeader = "OpenAI-Organization"
8+
static let contentTypeKey = "Content-Type"
9+
static let contentTypeValue = "application/json"
810
}

Sources/ACMOpenAI/Manager/Base/BaseManager.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@ public class BaseAPIManager: BaseManager {
3333
endpoint = endpoint
3434
.add(header: ACMHeaderModel(field: ACMOAIConstants.organizationHeader, value: organization))
3535
}
36+
37+
endpoint = endpoint.add(header: ACMHeaderModel(field: ACMOAIConstants.contentTypeKey, value: ACMOAIConstants.contentTypeValue))
3638
}
3739
}

0 commit comments

Comments
 (0)