In Jmeter how to pass Date as String/text - date

I need to pass a date (12/12/2016) as a Text parameter to a Post request.
It picks %2f instead of '/'. how do i pass this as string with date having slash.

I tried to send date value as Text/string in parameters tab. whether I select/unselect Encode? parameter, sending by encoding the date value.
Keeping the value in Body Data section worked for me.
So, try by moving all the Post data into Body Data section instead of Parameters section.

Related

Playframework - ISO format date with timezone in request query param is incorrectly parsed

Why the following iso format date is parsed incorrectly?
GET /find?account.create_date=2016-06-01T00:00:00.000+05:45
In the controller, if I print the queryString, I get the following result:
println(request.queryString)
//result - Map(account.create_date -> Buffer(2016-06-01T00:00:00.000 05:45))
As, you can see, the timezone sign is missing 05:45 instead of +05:45. However, negative timezone work well. 2016-06-01T00:00:00.000-05:45 is successfully parsed as it is.
This is because the ISO date format is not compliant with the URL encoding (RCF-3896 which has a special use for space and : characters). Playframework will be automatically URL decoding the querystrings you pass in the URL for you.
The correct date time string should have been
GET /find?account.create_date=2016-06-01T00%3A00%3A00.000%2B05%3A45
You can read more about the URL encoding here: https://en.wikipedia.org/wiki/Percent-encoding

MailKit : search if custom header exists

I have added a custom header in emails, conditionally
and I want using the IMAP/SearchQuery to return only the mails having the header.
Not its value, only to return true/false if the header exists.
Is it possible ? thanks.
According to rfc3501 (the IMAP specification):
HEADER <field-name> <string>
Messages that have a header with the specified field-name (as
defined in [RFC-2822]) and that contains the specified string
in the text of the header (what comes after the colon). If the
string to search is zero-length, this matches all messages that
have a header line with the specified field-name regardless of
the contents.
To make this search in MailKit, what you would do is this:
var results = folder.Search (SearchQuery.Header ("X-Custom-Header", string.Empty));
Edit:
I just discovered a logic bug in MailKit that would decide to send empty strings as ATOMs instead of QSTRING like it should. I've fixed this in git master, but have not made a release yet. I'll probably do that this weekend.

send the POST without URLencoding the data

I post a form,and the value is
<
But It last be enocded
%3C
So,how I keep <? or send the POST without URLencoding the data.
Try changing your forms enctype value to text/plain. The only encoding done by that is to replace spaces with + symbols.

PayPal Rest API date filtering not working. What am I doing wrong?

I am using the ruby paypal rest api and everything I do seems to be right but PayPal keeps saying my date format is incorrect.
Here is my call:
Payment.all(:start_time => '2013-03-06T11:00:00Z', :end_time => '2013-03-06T11:00:00Z')
After many attempts I literally took the date example in the documentation: https://developer.paypal.com/webapps/developer/docs/api/
Because no matter what I do I keep getting the same response:
'{"name":"VALIDATION_ERROR","details":[{"field":"start_time","issue":"Must
be a date_time string of form yyyy-mm-ddThh:mm:ss(.sss)?Z"},{"field":"end_time","issue":"Must
be a date_time string of form yyyy-mm-ddThh:mm:ss(.sss)?Z"}],"message":"Invalid
request - see details","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR","debug_id":"dcd8a9ce6a5e7"}'
Am I blind or does it not make sense?
Looks like it's a bug in our API where it's expecting raw value rather than url encoded value. The SDK was always url encoding the value of the start_time and end_time (or as a matter of fact all url parameters as per the HTTP spec). We have filed a bug and get this fixed as soon as possible. Meanwhile if this is something you need to work, we can possibly make the SDK not url encode the params or you can just modify the code for now locally.
I think your issue might be that you're setting both the start time and the end time to the same exact value. If you want a single day's worth of transactions the end time would be 2013-03-06T23:59:59Z.

How can I extract non-standard HTTP headers using Perl's LWP?

I'm working with a web application that sends some non-standard HTTP headers in its response to a login request. The header in question is:
SSO_STATUS: LoginFailed
I tried to extract it with LWP::Response as $response->header('SSO_STATUS') but it does not work. It does work for standard headers such as Set-Cookie, Expires etc.
Is there a way to work with the raw headers?
if you see the documentation of HTTP::Headers, it states that
The header field name spelling is normally canonicalized
including the '_' to '-' translation. There are some application where
this is not appropriate. Prefixing field names with ':' allow you to
force a specific spelling. For example if you really want a header field
name to show up as foo_bar instead of "Foo-Bar", you might set it like
this:
$h->header(":foo_bar" => 1);
These field names are returned with the ':' intact for
$h->header_field_names and the $h->scan callback, but the colons do
not show in $h->as_string.
See this thread on Perlmonks.
You need to access the value of the header field as $response->header('SSO-STATUS').
The syntax for setting fields with underscores in names:
$response->header(':SSO_STATUS' => 'foo');