+int afb_hreq_init_req_call(struct afb_hreq *hreq, const char *api, size_t lenapi, const char *verb, size_t lenverb)
+{
+ free(hreq->api);
+ free(hreq->verb);
+ hreq->api = strndup(api, lenapi);
+ hreq->verb = strndup(verb, lenverb);
+ if (hreq->api == NULL || hreq->verb == NULL) {
+ ERROR("Out of memory");
+ errno = ENOMEM;
+ return -1;
+ }
+ return afb_hreq_init_context(hreq);
+}
+