Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

[SOLVED] OAuthUtility.Post parameter json body #42

Open
dpmontero opened this issue May 31, 2019 · 1 comment
Open

[SOLVED] OAuthUtility.Post parameter json body #42

dpmontero opened this issue May 31, 2019 · 1 comment

Comments

@dpmontero
Copy link

Hi,
what is the correct way to create a raw body data parameter?
This does not send the parameter correctly:

Dim json As String = Me.TextBox1.Text

Dim result = OAuthUtility.Post("http://192.168.1.35:8000/api/v1/copies/fam",
                                        parameters:=New HttpParameterCollection From {
                                        New HttpRequestBody(json)},
                                        contentLength:=json.Length,
                                        contentType:="application/json",
                                        headers:=New NameValueCollection From {
                                            {"Authorization", String.Format("Token {0}", token)}
                                        })

Like this in postman:
image

@dpmontero dpmontero changed the title OAuthUtility.Post parameter json body [SOLVED] OAuthUtility.Post parameter json body Jun 3, 2019
@dpmontero
Copy link
Author

SOLVED!

 OAuthUtility.Post(endpoint:=requestURL.ToString,
                          parameters:=parameters,
                          allowSendChunked:=False,
                          allowWriteStreamBuffering:=True,
                          contentLength:=jsonData.Length,
                          contentType:="application/json",
                          headers:=New NameValueCollection From {
                               {"Authorization", String.Format("Token {0}", token)}
                          })

Thanks @alekseynemiro it's a great utility!!, in my case, when the SO is WinXP don't work TLS12 https connections, with that works.

When the monetize application I will make a donation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant