On Sun, 13 May 2018 21:14:52 GMT, aliak wrote:


New to vibed here. I'm trying to get some API integrations working and I have a curl command that works fine, but when I try the same with requestHTTP I get a 404 not found form the API in question. I can't seem to see the difference. Halp!

Curl Command:

curl -i -H "Accept: application/vnd.github.machine-man-preview+json" -H "Authorization: Bearer <token>" https://api.github.com/installations/:id:/access_tokens -X POST

Vibe-d request:

auto response = requestHTTP("https://api.github.com/installations/" ~ installationId.to!string ~ "/access_token/", (scope request) {
        request.method = HTTPMethod.POST;
        request.headers["Accept"] = "application/vnd.github.machine-man-preview+json";
        request.headers["Authorization"] = "Bearer " ~ makeAccessToken;

I have verified that makeAccessToken in the code and <token> in the curl are identical. And I've verified that :id: in the curl URL and installationId are the same too.

Is there something I'm missing?

Thanks for any help!

Ok fml... missing 's' at the end!

Nevermind all good :)