CB
CB
CDCloudflare Developers
Created by CB on 7/31/2023 in #workers-help
Local development with service bindings gives error when calling service
I will fix that. Sorry for submitting a javascript issue.
6 replies
CDCloudflare Developers
Created by CB on 7/31/2023 in #workers-help
Local development with service bindings gives error when calling service
I see what you mean. It is new Request (url, options)
6 replies
CDCloudflare Developers
Created by CB on 7/31/2023 in #workers-help
Local development with service bindings gives error when calling service
oh, I am sorry. I didn't realize i was doing that wrong. what URL should I use when trying to hit another service with a service binding
6 replies
CDCloudflare Developers
Created by CB on 7/31/2023 in #workers-help
Local development with service bindings gives error when calling service
Here is what my code looks like:
var postBody = {
"action": "LeadsList",
"token": credentials.token,
}


var clonedRequest = request.clone();

var zohorequest = new Request({
url: clonedRequest.url,
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(postBody),
})

var zohoresponse = await env.zohocrm.fetch(zohorequest)
var postBody = {
"action": "LeadsList",
"token": credentials.token,
}


var clonedRequest = request.clone();

var zohorequest = new Request({
url: clonedRequest.url,
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(postBody),
})

var zohoresponse = await env.zohocrm.fetch(zohorequest)
6 replies