#community-help

Generating cURL String from Client Libraries for MultiSearch in Golang

TLDR Raymond asked about generating a cURL string from client libraries in Golang. Kishore Nallan advised debugging through the client into the http layer. Raymond fixed the issue and suggested a cURL feature for debug purposes.

Powered by Struct AI
7
9mo
Solved
Join the chat
Mar 16, 2023 (9 months ago)
Raymond
Photo of md5-d1db605d34a264b4a156daf03e69661a
Raymond
12:45 PM
Hey Jason Kishore Nallan 👋

Is there a way to generate a cURL string from client libraries? I am trying to replicate a query being used in a MultiSearch request using the Golang library but it's been a little challenging to pull off.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:46 PM
No, that's not possible. But if you can post the query I can help with some pointers.
Raymond
Photo of md5-d1db605d34a264b4a156daf03e69661a
Raymond
12:51 PM
Hmm, thanks. Let me try something out on my end for now.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:53 PM
One thing you can do is to debug through the client into the http client layer. That way you should be able to get the underlying request body object.
Raymond
Photo of md5-d1db605d34a264b4a156daf03e69661a
Raymond
12:54 PM
I see, thanks
01:00
Raymond
01:00 PM
Fixed. Thanks a lot. Was easy, just needed a refersher.

Do you think something like the cURL thing would be useful for debug purposes?

I can find some time to open a PR for the golang repo for it.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:22 PM
Yes it would be useful if it's not difficult to pull off.