Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 600 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 600 Bytes

Simple REST Library writen in GO for use in C/C++ projects

Usage

#include <stdio.h>
#include <stdlib.h>

#include "request.h"
#include "response.h"

extern Response DoRequest(Request request);

int main() {
    Request request = {
        .Method     = GET,
        .URL        = "http://example.com",
        .Header     = "Accept: application/json",
        .UserAgent  = "rest-c",
    };

    struct Response response = DoRequest(request);

    printf("error: %s \n", response.Error);
    printf("statusCode: %d \n", response.StatusCode);
    printf("body: %s \n", response.Body);
}