Skip to content

Commit 1a09822

Browse files
AnnatarHeclaude
andcommitted
feat(model)!: change default HTTP send method from msgpack to JSON
BREAKING CHANGE: Renamed SendHTTPRequest to SendHTTPRequestJSON to reflect the change in default serialization format from msgpack to JSON. This affects all API calls using the HTTP request function. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 403ff43 commit 1a09822

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

model/alias.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func SendAliasesToServer(ctx context.Context, endpoint Endpoint, aliases []strin
8080

8181
var resp importShellAliasResponse
8282

83-
err = SendHTTPRequest(HTTPRequestOptions[importShellAliasRequest, importShellAliasResponse]{
83+
err = SendHTTPRequestJSON(HTTPRequestOptions[importShellAliasRequest, importShellAliasResponse]{
8484
Context: ctx,
8585
Endpoint: endpoint,
8686
Method: http.MethodPost,

model/api.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,12 @@ type PostTrackArgs struct {
4848
}
4949

5050
func doSendData(ctx context.Context, endpoint Endpoint, data PostTrackArgs) error {
51-
52-
err := SendHTTPRequest(HTTPRequestOptions[PostTrackArgs, any]{
53-
Context: ctx,
51+
err := SendHTTPRequestJSON(HTTPRequestOptions[PostTrackArgs, any]{
52+
Context: ctx,
5453
Endpoint: endpoint,
55-
Method: http.MethodPost,
56-
Path: "/api/v1/track",
57-
Payload: data,
54+
Method: http.MethodPost,
55+
Path: "/api/v1/track",
56+
Payload: data,
5857
Response: nil,
5958
})
6059
logrus.Traceln("http: ", "/api/v1/track", len(data.Data), data.Meta)

model/dotfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func SendDotfilesToServer(ctx context.Context, endpoint Endpoint, dotfiles []Dot
7373

7474
var resp dotfilePushResponse
7575

76-
err = SendHTTPRequest(HTTPRequestOptions[dotfilePushRequest, dotfilePushResponse]{
76+
err = SendHTTPRequestJSON(HTTPRequestOptions[dotfilePushRequest, dotfilePushResponse]{
7777
Context: ctx,
7878
Endpoint: endpoint,
7979
Method: http.MethodPost,

0 commit comments

Comments
 (0)