can we upload a file from put or post in netlib? - c++

I want some server for my post or put request in cpp.I have choose netlib.. so i want to know that can we upload some xml or json file from put or post request in netlib.
Can anyone answer this question. because i m struck with this.
Thanks
Vishnkumar.

Related

How can I Upload a feed via postman to Amazon Sp-API?

I've spent weeks, hours daily trying to figure out how to upload a feed (POST_FLAT_FILE_PRICEANDQUANTITYONLY_UPDATE_DATA) to Amazon sp API.
Before even attempting to do it in PHP, I want to 1st make it work on Postman.
I've been successful getting a FEED ID and a FEED URL (I Used content type: "text/xml; charset=UTF-8" since it's a flat file (CSV not XML).
Although, If I can make it work easier via XML I Would gladly switch. I just want to be able to update my inventory and price in same feed.
Are there are links to a postman configuration to upload to a feed?
I think I'm supposed to use "PUT" and upload to the Feed url but I can't find an already complete postman config for it.
Any help would be soooooooo appreciated.
Thank you so much!

How do I send an HTTP post request with headers and json data through a proxy with WinHTTP (C++)

I am attempting to send a post request like the one described in the title, but I cannot seem to find a good example of a generic piece of code. My work on my project is a bit tedious as I have never used WinHTTP, only libcurl before which is why I decided to ask here. To reiterate, the http request is a post request with specific header values and json data in the request body which is sent through a proxy to a website using winHTTP. If anyone could provide me with assistance, it would be greatly appreciated.

How to use the url that came in response

Help to understand and direct what needs to be done further. I use the robot framework version 3.1.1 and the Python 2.7 programming language to write the autotest script, and now there is a task to develop a test that will work with POST / GET requests. So, I make a POST request to the system to initiate a payment. The answer comes that the payment has been created, but for all actions it is necessary to follow the link inside the answer.
Request:
Create Session allias URL
&{params}= Create Dictionary params1=value1 params2=value2
${resp}= Post Request allias /init_payment.php params=${params}
Should Be Equal As Strings ${resp.status_code} 200
Reply post response:
<?xml version="1.0" encoding="utf-8"?>
<response><pg_status>ok</pg_status><pg_payment_id>3016695</pg_payment_id><pg_redirect_url>https://test.paybox.money/payment.html?customer=028c44bf25b6be251199221d04b570c2</pg_redirect_url><pg_redirect_url_type>need data</pg_redirect_url_type><pg_salt>8OYUsodtnaTWKbOD</pg_salt><pg_sig>a26e61d6eb710c430d67150498d1f555</pg_sig></response>
How to show the framework so that it can go through the redirect url? I would be very grateful for your help.
The RequestsKeywors from the Robot Framework use Requests HTTP Client. Reading the quickstart from this library you can find that the response's contents is available in the text field.
${body}= ${resp.text}
Then you'd most likely want to parse the XML. You can use the XML library for that.
It will be something like
${root} = Parse XML ${body}
${link} = Get Element Text ${root} response/pg_redirect_url

Giving value to parameter from a file to send it through HTTPPOst

I have been struggling with Jenkins lately, and I'm stuck because I wanna send some parameters through HTTP Post, and I know how to do it, but the thing is that I am saving a Http request response to a file in my workspace, and then I want to use that file, read it and send the text I saved previously to a new HTTP Request, does anyone have any idea how can I achieve this?
Thanks in advance!!!
Install copy artifacts from another project plugin ( copy artifacts) add in build steps store the file in your workspace then you can run a shell script to read the desired content from that file .
if curl would work, that would be a simple way to send a file's contents as your POST body. see this answer.
Jenkins can work with Jmeter and Jmeter is great tool for handling request and response see tutorial

Save html page after JSON - AJAX post request

I use curl in C++ to download an html page from a website, then I save it.
After I've saved the html file, with another programm I've to read it, and save it in a string.
This page contain some request (POST) made by JSON-AJAX. If I open it with the broswer I have the right content. If I open it with a text editor I have a bad content because the POST request is not made.
So how can I save the page whit the content obtained after JSON-AJAX request??
Curl will download the HTML code from the page and that's it. When you open the HTML file with a web browser, the browser is taking care of whatever post request is being sent.
You need to find out what the post request contains (i.e., the data and how it's obtained) and send that request separately and save the response.
You might want to look into this question How do you make a HTTP request with C++?