Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Body data is not being sent when using PUT verb (Scrapingbrowser) #18

Open
rafafranklin opened this issue May 9, 2019 · 1 comment
Open

Comments

@rafafranklin
Copy link

I'm trying to send some data on the request body using PUT verb but is not working. Nothing is sent.

Does anyone know how to solve that?

This is my code:

data = "{\"assignee\":\"" + USER_NAME + "\"}";
browser.NavigateToPage(new Uri(URL), HttpVerb.Put, data);

When looking the request through fiddler i can see nothing is being passed on the body.

@rafafranklin
Copy link
Author

I noticed the following IF condition on the source code. Although, i'm getting errors to compile a new version due to some dev environment issues.

Would be nice a new vesion supporting data on PUT and DELETE verbs.

if (verb == HttpVerb.Post)
               request.ContentType = contentType ?? "application/x-www-form-urlencoded";

           request.CookieContainer = cookieContainer;

           if (verb == HttpVerb.Post)
           {
               var stream = request.GetRequestStream();
               using (var writer = new StreamWriter(stream))
               {
                   writer.Write(data);
                   writer.Flush();
               }
           }

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

No branches or pull requests

1 participant