You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building an integration to a MIVA webstore and was baffled by why the API calls were not working from VBA-Web, but the identical call worked just fine from VSCode rest client.
After tracing the call in fiddler, I discovered the problem. For some reason the calls made through VBA-Web are changing the Content-Type header from application/json to application/json; Charset=UTF-8. The endpoint that I am calling is expecting exactly application/json, so it returns a failure base on the "wrong content type".
Why would it be appending the charset parameter, and how can I prevent it from doing so?
The text was updated successfully, but these errors were encountered:
Only place i see charset= in the current code is in FormatToMediaType which has. Maybe do a Search in your project and see if you find something else?
Public Function FormatToMediaType(Format As WebFormat, Optional CustomFormat As String) As String
Select Case Format
Case WebFormat.FormUrlEncoded
FormatToMediaType = "application/x-www-form-urlencoded;charset=UTF-8"
Case WebFormat.Json
FormatToMediaType = "application/json"
Case WebFormat.xml
FormatToMediaType = "application/xml"
Case WebFormat.Custom
FormatToMediaType = web_GetConverter(CustomFormat)("MediaType")
Case Else
FormatToMediaType = "text/plain"
End Select
End Function
I am building an integration to a MIVA webstore and was baffled by why the API calls were not working from VBA-Web, but the identical call worked just fine from VSCode rest client.
After tracing the call in fiddler, I discovered the problem. For some reason the calls made through VBA-Web are changing the Content-Type header from
application/json
toapplication/json; Charset=UTF-8
. The endpoint that I am calling is expecting exactlyapplication/json
, so it returns a failure base on the "wrong content type".Why would it be appending the charset parameter, and how can I prevent it from doing so?
The text was updated successfully, but these errors were encountered: