| 423 | } |
| 424 | |
| 425 | func 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 | |
| 444 | func GetUserInfo(pds string, token string, screen_name string, nocache bool) (*bridge.TwitterUser, error) { |
| 445 | if !nocache { |