MCPcopy Create free account
hub / github.com/Preloading/TwitterAPIBridge / SendRequestWithContentType

Function SendRequestWithContentType

bluesky/blueskyapi.go:425–442  ·  view source on GitHub ↗
(token *string, method string, url string, body io.Reader, content_type string)

Source from the content-addressed store, hash-verified

423}
424
425func SendRequestWithContentType(token *string, method string, url string, body io.Reader, content_type string) (*http.Response, error) {
426 client := &http.Client{}
427 req, err := http.NewRequest(method, url, body)
428 if err != nil {
429 return nil, err
430 }
431 if token != nil {
432 req.Header.Set("Authorization", "Bearer "+*token)
433 }
434 req.Header.Set("Content-Type", content_type) // 99% sure all bluesky requests are json.
435
436 resp, err := client.Do(req)
437 if err != nil {
438 return nil, err
439 }
440
441 return resp, nil
442}
443
444func GetUserInfo(pds string, token string, screen_name string, nocache bool) (*bridge.TwitterUser, error) {
445 if !nocache {

Callers 1

UploadBlobFunction · 0.85

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected